How can I figure out how much memory is consumed by .Net appdomain?

I am trying to programmatically limit memory consumption by plugins running in .Net AppDomain, but I cannot find any settings for this, and I cannot find a way to query AppDomain to find out how much memory it consumes. Any ideas?

+6
clr
source share
4 answers

Here is the documentation for requesting process memory usage. Not the same as AppDomain, but this may be the place to start.

http://msdn.microsoft.com/en-us/library/s80a75e5(VS.80).aspx

You can ask GC what, in his opinion, is currently also highlighted.

http://msdn.microsoft.com/en-us/library/system.gc.gettotalmemory(VS.71).aspx

0
source share

An old question, but in the meantime (starting with the .Net framework 4.0) a new solution is available. You need to enable ARM (application domain resource monitoring). From now on, you can request information about the total processor time consumed, memory usage, etc.

See Microsoft documentation here

+3
source share

Not sure programmatically, but Process Explorer can tell you how much memory .net AppDomain uses. Perhaps they have documentation on how they request this information.

+2
source share

Using mscoree.CorRuntimeHostClass interop from C: \ WINDOWS \ Microsoft.NET \ Framework \ vXXXXXX \ mscoree.tlb

0
source share

All Articles