Process WorkingSet64

Use this forum to discuss subjects that don't belong in the other forums.
Post Reply
radnix
Posts: 6
Joined: Mon Aug 08, 2005 8:14 pm

Process WorkingSet64

Post by radnix » Sat Mar 29, 2008 2:24 pm

I wanted to document a potential leak situation that I resolved using .Net Memory profiler. If you see something incorrect here, feel free to correct me or provide better way. :)

Simple 2 second timer :

private void Timer_Tick(object sender, EventArgs e)
{
double phy_mem = Process.GetCurrentProcess().WorkingSet64;
......do stuff....
}

Profiling show ever increasing UnDisposed on real time graph. Taskmanager shows slight memory increase but seems to indicate garbage collector does handle it eventually.

Replacing the above process getcurrentprocess workingset64 line with:

using(System.Diagnostics.Process x = Process.GetCurrentProcess())
{
phy_mem = x.WorkingSet64;
}

Profiler real time graph for process clean, taskmanager shows no memory increase or fluctuation.

Nice...... 8)
...of all the things I've lost, I miss my mind the most.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests