I see your point. I'm actually loading a copy of the loaded assembly in the
other app-domain, and so you're right - it will be loaded in both places.
But apart from being loading in domains - there shouldn't be any
relationship between them other than the proxy object resulting from the
"CreateInstanceAndUnwrap" method (would that be correct??).
The reason I'm doing this is so that I can initialize a new copy of the
assembly to talk to a remoting server. If the server is not there, then I
unload the app-domain. Apart from this problem - I've found that is a clean
way to handle the issue of a stale server.
I'm running a polling routine - which repeats this process over and over in
an attempt to re-connect, which is where I'm noticing the memory-leak as the
size of the processe's memory usage just keeps going up.
Thanks David.
==
Phil
>I see your point. I'm actually loading a copy of the loaded assembly in
>the other app-domain, and so you're right - it will be loaded in both
[quoted text clipped - 12 lines]
> in an attempt to re-connect, which is where I'm noticing the memory-leak
> as the size of the processe's memory usage just keeps going up.
How much is it going up by? As I said I am aware of a small leak but that
does not mean that there may not be other leaks. If it is a large leak then
you should look at your code talking to the server to ensure that it is not
allocating an unmanaged object that is not getting released.
Personally, I'd be wary of creating and destroying a large quantity of
appdomains in an application that was intended to remain running for very
long periods of time, at least in version 1.1.
> Thanks David.
> ==
> Phil
Phil Jones - 13 Apr 2005 02:00 GMT
> Personally, I'd be wary of creating and destroying a large quantity of
> appdomains in an application that was intended to remain running for very
> long periods of time, at least in version 1.1.
OK, that's good to know - I'll think of another way around this. The memory
usage is jumping up about 1MB each time I create/shutdown the domain.
Everything inside the app-domain is native .NET objects (no COM interop).
Would that still qualify for a memory leak??
I appreciate all you help on this David!
Thanks
====
Phil
David Levine - 14 Apr 2005 02:12 GMT
Yah, that's a memory leak all right. Without detailed information I have no
idea what could cause it, but I'd suggest using some memory probes on it.
There are some free tools and also some commercial tools you can use. I'd
start with the free ones and try to narrow it down. At a minimum you need to
find out what objects are using up that memory.
>> Personally, I'd be wary of creating and destroying a large quantity of
>> appdomains in an application that was intended to remain running for very
[quoted text clipped - 9 lines]
> ====
> Phil
Phil Jones - 14 Apr 2005 10:27 GMT
Hi David,
Do you have any prefs or suggestions on a good "free memory profiling tool"
to start off with?
Many thanks for your help with all of this!
===
Phil
David Levine - 15 Apr 2005 10:44 GMT
http://www.microsoft.com/downloads/details.aspx?FamilyId=86CE6052-D7F4-4AEB-9B7A
-94635BEEBDDA&displaylang=en
This is the MSFT CLR profiler. You can easily google up a list of other
profilers (not all free)
> Hi David,
>
[quoted text clipped - 4 lines]
> ===
> Phil
Phil Jones - 16 Apr 2005 21:57 GMT
Thanks David - appreciate it!