.net app continously writing data normal?

  • Thread starter Thread starter Andreas Zita
  • Start date Start date
A

Andreas Zita

When observing the column "data written" in the activity manager for my .net
app I discovered that 2-4000kB of data is being written every second to the
disk. This is when the app is idle and not used. Is this normal? If not,
what can be causing it?

/Andreas Z
 
What exactly is the "activity manager" and it's "data written" column?

Willy.
 
Sorry ... Im running a Swedish version of XP and I don't exactly now the
correct translations to English XP. In Swedish its "Aktivitetshanteraren"
och "I/O antal byte skrivna" ... Im referring about the tool in XP which
monitors application currently in memory and its properties ...

/AZ
 
Ok, PermormanceMonitor" and "IO write bytes/sec" for the "process" category,
right?
Well, 2-4MB per second written for your process only is not normal, unless
you are performing disk IO in your OnIdle loop (which I guess you are not) ,
must be a bug in your code.

Willy.
 
Doh ... I meant 2-4000 bytes/sec ... (not kB) ... sorry again ...

But should a .net app write anything at all unless Im doing it explicitly?

/AZ
 
I found out the cause for this!
The two commented lines was causing it ... but i don't now why ...

/AZ

[STAThread]
static void Main()
{
//System.Diagnostics.Process[] p =
System.Diagnostics.Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
//if (p.Length == 1)
Application.Run(new Form1());
}
 
Any Win32 process can perform some disk IO when you might not expect it to
do so, the registry is something that get accessed frequently and the also
CLR performs some IO because it's publishing performance counter data
through the memory mapped registry.
In your case the IO is induced by a performance counter data that's been
read when querying for process data counters (GetProcessesByName), this has
been corrected in v2.0 which doesn't use perfcounters any longer for this.
Note also that what you are trying to achieve is not the right way to check
whether another instance of this application is running, you should opt for
a solution based on a named Mutex to prevent multiple instances.

Willy.
 
Thanks a lot Willy! Your the man! I look into using Mutex ...

/AZ

Willy Denoyette said:
Any Win32 process can perform some disk IO when you might not expect it to
do so, the registry is something that get accessed frequently and the also
CLR performs some IO because it's publishing performance counter data
through the memory mapped registry.
In your case the IO is induced by a performance counter data that's been
read when querying for process data counters (GetProcessesByName), this
has been corrected in v2.0 which doesn't use perfcounters any longer for
this.
Note also that what you are trying to achieve is not the right way to
check whether another instance of this application is running, you should
opt for a solution based on a named Mutex to prevent multiple instances.

Willy.

Andreas Zita said:
I found out the cause for this!
The two commented lines was causing it ... but i don't now why ...

/AZ

[STAThread]
static void Main()
{
//System.Diagnostics.Process[] p =
System.Diagnostics.Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
//if (p.Length == 1)
Application.Run(new Form1());
}
 
Back
Top