<p>I'm trying to programmatically restrict the memory consumption of plugins running in a .Net AppDomain, but I can't find any setup parameters for this, nor can I find a way to query an AppDomain to figure out how much memory it is consuming. Any ideas?</p>

[{'answer_id': 26226, 'author': 'TheEmirOfGroofunkistan', 'author_id': 1874, 'author_profile': 'https://Stackoverflow.com/users/1874', 'pm_score': 2, 'selected': False, 'text': '<p>Not sure programatically, but <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="nofollow noreferrer">Process Explorer</a> can tell you how much memory a .net AppDomain is using.  Maybe they have some documentation out there about how they are querying that info.</p>\n'}, {'answer_id': 27403, 'author': 'Ben Robbins', 'author_id': 1880, 'author_profile': 'https://Stackoverflow.com/users/1880', 'pm_score': 1, 'selected': True, 'text': '<p>Here\'s the documentation for querying a process\'s memory usage. Not the same as the AppDomain, but it might be a place to start.</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/s80a75e5(VS.80).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/s80a75e5(VS.80).aspx</a></p>\n\n<p>You can ask the GC what it thinks is currently allocated also.</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/system.gc.gettotalmemory(VS.71).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.gc.gettotalmemory(VS.71).aspx</a></p>\n'}, {'answer_id': 9524654, 'author': 'Rolf Huisman', 'author_id': 675826, 'author_profile': 'https://Stackoverflow.com/users/675826', 'pm_score': 0, 'selected': False, 'text': '<p>Using the mscoree.CorRuntimeHostClass interop from C:\\WINDOWS\\Microsoft.NET\\Framework\\vXXXXXX\\mscoree.tlb</p>\n'}, {'answer_id': 29427937, 'author': 'Björn Boxstart', 'author_id': 1718177, 'author_profile': 'https://Stackoverflow.com/users/1718177', 'pm_score': 3, 'selected': False, 'text': '<p>Old question, but in the meantime (since .Net framework 4.0) a new solution is available. You will have to enable ARM (Application domain Resource Monitoring). From that point on, you can request information on total consumed processor time, memory usage etc.</p>\n\n<p><a href="https://msdn.microsoft.com/en-us/library/dd997285%28v=vs.110%29.aspx" rel="noreferrer">See Microsoft documentation over here</a></p>\n'}]
['https://Stackoverflow.com/questions/26074', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2483/']