Process WorkingSet64

Use this forum to discuss subjects that don't belong in the other forums.

Moderator: SciTech Software

Process WorkingSet64

Postby 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.
radnix
 
Posts: 6
Joined: Mon Aug 08, 2005 8:14 pm
Location: Huntsville AL

Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

SciTech Software logo

© Copyright 2001-2016. SciTech Software AB
All rights reserved.


SciTech Software AB
Kartvägen 21
SE-175 46 Järfälla
Sweden


E-mail: mail@scitech.se

Telephone: +46-706868081