Shaitan00 Posted August 9, 2006 Posted August 9, 2006 When the Out_Of_Memory exception is caught I want to log the systems current memory usage (not application, system), minimally free memory... Preferably also max memory, free VM and max VM, and anything else that can pin point the system state when it crashes... Now I know how to do this in WMI or Script but I have not been able to find a way to accomplish this task in C# (2005/2.0)... Any ideas, hints, and help would be greatly appreciated, thanks Quote
Administrators PlausiblyDamp Posted August 9, 2006 Administrators Posted August 9, 2006 Some of the ideas mentioned in http://www.xtremedotnettalk.com/showthread.php?t=90123 may be worth looking at. In terms of getting memory usage you could always use the performance monitor counters to get at the running values. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Shaitan00 Posted August 10, 2006 Author Posted August 10, 2006 The idea is - the exception is "Out Of Memory" so I want to see the memory at 0 - so I thought if I outputed the actual memory usage I would see it be 0... I just find it odd that my program, while loading the map, can max out a 128meg ram machine running XP SP2.... odd indeed... Quote
Leaders snarfblam Posted August 10, 2006 Leaders Posted August 10, 2006 Maybe you should upload some code. It sounds like you have some severe memory management issues. Perhaps you are doing lots of string processing and the garbage collector is not getting a chance to clean up all the old strings (this can, on a very large scale operation, eat a huge amount of memory), or you aren't disposing large objects, or something to that effect. If you upload all of the code in question we could analyze it and possibly identify some issues. Quote [sIGPIC]e[/sIGPIC]
Shaitan00 Posted August 11, 2006 Author Posted August 11, 2006 marble_eater: I have attached a full set of CLR Profiler logs to another post on a similar topic (http://www.xtremedotnettalk.com/showthread.php?p=458499#post458499), hopefully that can help in the analysis... As for code, I am working on posting some snipplets with explanation on areas where I think I may possibly be leaking memory, etc ... - I'll follow up shortly (I need to write it out first). Thanks for the help - much appreciated... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.