Hi
I have a .NET windows App in which I load Assemblies using Assembly.Load
into the current Application Domain, Search for Types which implement certain
interfaces and then create Instance of each of these types and call some
methods on eacn Type. I am making use of Activator.CreateInstance(type)
method to create instances of these types. Everything works fine.. untill u
know that each time this code fires, memory utilization increases
incrementaly. For Ex. If the Windows App took 30MB. each time this code
executes, the memory utilization goes like this 40MB, 50MB, 60MB (approximate
values).
How should I take take of cleaning up memory? .Also, since I make use of the
Activator Class to create Instances does it mean the objects that get created
are contained in the App Domain? In which case the only way I can think of
achieving this is to create a New App Domain and Unload it.
Please advice.

Signature
arvind
john conwell - 05 Apr 2005 17:01 GMT
Yep, you guessed it. When ever you load an assembly into your AppDomain,
your stuck with that assembly for the life of the AppDomain. Your only
choice, if you want to keep the memmory consumption to a miminum, is to
create a second AppDomain and load your extra assemblies into there. then
when you are finished with the assembly, just drop the AppDomain.
> Hi
>
[quoted text clipped - 14 lines]
>
> Please advice.