Since we cannot unlaod a assembly,Is there any reference about this indicate that this problem won't

  • Thread starter Thread starter navyliu
  • Start date Start date
N

navyliu

I have raised a discussion about assembly unloading.But we can't get a final
solution.
Since we cannot unlaod a assembly,Is there any reference about this indicate
that this problem won't make smartclient use up memory?

Best regard
navyliu
 
navyliu said:
I have raised a discussion about assembly unloading.But we can't get a final
solution.
Since we cannot unlaod a assembly,Is there any reference about this indicate
that this problem won't make smartclient use up memory?

Best regard
navyliu

You can't unload an Assembly, but you can unload an AppDomain. So, if
you really need to dynamically load/unload an assembly, just create a
new appdomain and load the assembly there. Of course, there is a
performance hit for this because now all calls to the assembly are
marshalled across domain boundries.
 
hi Tom,thank you for you answer.
My scene is following.
I want to devolop a smart client application. I designed a plugable
framework and all the plug-ins are UserControls.
Since there are so many plug-ins,I separate the plug-ins into several
assemblies.While runtime,I load the plug-ins
with reflaction.
The one thing I'm warring about is that as the Assemblies loaded,the memory
is more and more used and cann't be
free until the application is closed,the PC's memory can be used up.

Loading assembly in a separate AppDomain cannot solve my problem.
I have to load add-ins(usually are UserControls) to my plugable framework.
That's to say i have to bring one object from one AppDomain to another
AppDomain.
The way to do that is Remoting. Yes i can Remote UserControls,but the
usercontrol
after remoting can not be used as UserControl. So that's not the right
solution.

Best regard
navyliu
 
If this makes the smartclient use up memory depends on how assemblies are
loaded. The memory usage will be about the same, as if all used assemblies
where linked staticly. Maybe some overhead. So, if you load many different
assemblies inside the same AppDomain, there will much memory usage, mut not
much more, if all those assemblies were linked staticly.

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top