I am profiling an application to check when instances get diposed/removed. I am using the real-time view, and when i destroy an object the "live instances" never seems to get updated until i go to the menu and select "Collect heap snapshot". Then it suddenly updates all the instances.
Can i please ask how i can refresh the data in real-time as i was hoping without needing to perform to a snapshot to update the real time view?
When you collect a heap snapshot, a GC will be induced, which will force the "Live instances" value to be updated.
You can use the GC.Collect() method within the profiled process to force the "Live instances" value to be updated, but this should only be done for testing purposes. To minimize the effect on memory usage, I recommend that you only perform a generation #0 collect (GC.Collect(0)).
SciTech Software AB
I also face the similar situation, where i Need to find whether my application would perform Garbage collection properly.
I am performing addition of devices and performing one operation at each stage. Checking at each stage how much is the Total Instances & Live instances (last GC ) .
As per real time data: Total instances keep getting added. GC would never gets updated. This gave me an impression like GC is not happened successfully.
Kindly suggest without the memory snapshot how to get exact results. When I do snapshot real time data gets updated also GC . This is not right!
Either real time data should get updated properly. Or else snapshot should not get updated once captured.
Please let me know if this issue is addressed somewhere else.
The .NET runtime performs the garbage collection when it needs to collect the managed memory. The actual time when the GC is performed and what generation is collected, depends on several parameters, e.g. the allocation patterns in the application, the amount of memory collected previously, and the amount of memory available on the system. This makes it hard to predict when a GC will occur.
The Live bytes count presented in the real-time view can help you identify how well the garbage collector works. Unfortunately, this value is normally only updated after a full (gen #2) garbage collection. To update it after each garbage collection, you can select the "High" profiling level when you start profiling your application. However, this will cause your application to run slower.
You can read a bit more about the Total bytes/Live bytes real-time data at: http://memprofiler.com/onlinedocs/acomm ... eplots.htm
SciTech Software AB
Users browsing this forum: No registered users and 5 guests