How to check memory usage of all static objects in a c#.net application [closed]
I have loads of static object in my application. Want to check the memory usage of all static object , whether they are efficient to lie inside the memory from the time application is created (in mean once the application pool starts or its restarted)
don't want to use any of the tools or exe's , want to have my own Lib to check
Edit Post : Need some s开发者_开发知识库imple way in the code , by which I would be able to trace the memory usage of static methods , members. Using these parameters I would be able manage profiler / monitor for my system
you should use a profile because it is impossible to do is at runtime and bear in mind that the size of an actual object doesn't include the size of any objects it references.
A quick tip (but not accurate) could be to Serialize the object and check the buffer length which should stick to the object size
精彩评论