Fix a bunch of memory problems in beagle:
commit7797960cfed0d536dde07aa5364bc3b8b5246f0e
authorjoeshaw <joeshaw>
Wed, 25 Oct 2006 19:39:45 +0000 (25 19:39 +0000)
committerjoeshaw <joeshaw>
Wed, 25 Oct 2006 19:39:45 +0000 (25 19:39 +0000)
treea68994b721c0c6efe532f0c92c088b7a8ccbd1b0
parent6b13be13b0db2de0c27a09133e2eb66d816c706e
Fix a bunch of memory problems in beagle:

* Fix the usage of assembly.GetTypes() - Mono never GCs Type objects, and
calling GetTypes() instantiates evrey one of them contained in an
assembly.  Paired with some code that walked all the loaded assemblies,
we were instantiating thousands of types unnecessarily that stayed around
forever.

* Remove ReflectionFu methods that get all types that subclass from a type
or implement an interface; methods that do this should find a different
way.

* Implement assembly-scoped attributes for all of our dynamically loaded
types, including Queryables, Filters, Tiles, RequestMessages,
ResponseMessages, RequestMessageExecutors, and components in the
Thunderbird backend.  This means that these types now have to register
themselves to be loaded, but they can still be dynamically loaded from
outside assemblies.

* No longer run mono with --debug unless the --mono-debug variable is
passed to beagled.  This saves us some memory off the top, but there is
also some evidence that Mono leaks memory when this is turned on.

For me, these changes result in about a 40% reduction in startup memory.
30 files changed:
BeagleClient/AssemblyInfo.cs [copied from beagled/IQueryable.cs with 60% similarity]
BeagleClient/Makefile.am
BeagleClient/Message.cs
Filters/AssemblyInfo.cs [new file with mode: 0644]
Filters/Makefile.am
Util/Makefile.am
Util/ReflectionFu.cs
Util/TypeCacheAttribute.cs [copied from beagled/IQueryable.cs with 73% similarity]
beagled/AssemblyInfo.cs [new file with mode: 0644]
beagled/BeagleDaemon.cs
beagled/EvolutionBackendsAssemblyInfo.cs [copied from beagled/IQueryable.cs with 71% similarity]
beagled/EvolutionMailDriver/EvolutionMailDriver.cs
beagled/Filter.cs
beagled/FilterFactory.cs
beagled/IQueryable.cs
beagled/IndexHelper/RemoteIndexerExecutor.cs
beagled/Makefile.am
beagled/QueryDriver.cs
beagled/Server.cs
beagled/ThunderbirdQueryable/ThunderbirdIndexer.cs
beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs
beagled/beagled-index-helper.in
beagled/beagled.in
bludgeon/Toolbox.cs
search/Makefile.am
search/Tiles/AssemblyInfo.cs [copied from beagled/IQueryable.cs with 63% similarity]
search/Tiles/TileActivator.cs
tools/Config.cs
tools/Info.cs
tools/Query.cs