G
Guest
I am using Windows XP Professional with SP2.
I am writing an application that writes millions of small .txt files to the
filesystem. As files are opened and closed, there seems to be a memory leak
in the Windows OS, because after a little over a million files have been
created, my disk I/O speed significantly decreases. Additionally,
applications such as Task Manager cannot be executed. An error message pops
up indicating that the paged pool has been depleted. If I reboot the
machine, I can start creating new files again.
When I write the same amount of data to a single file (without opening or
closing new files), my application can run forever. This leads me to believe
that the leak occurs when opening and closing files.
The main loop of a small test application that I wrote to confirm that it is
not a problem with my code looks like this (where newfilename is unique
everytime through the loop):
while (true)
{
handle=CreateFile(newfilename, .... );
CloseHandle(handle);
}
Executing just those two lines over and over brings about the empty paged
pool symptoms. I have run poolmon.exe with this application running, and I
can see that the $Mft size and Mdl are growing rapidly in the non-paged pool,
and the MmSt paged pool tag was the big hitter in the paged pool.
Does anyone have any ideas of what is causing this? And maybe how I can
correct it?
Thanks,
Jake
I am writing an application that writes millions of small .txt files to the
filesystem. As files are opened and closed, there seems to be a memory leak
in the Windows OS, because after a little over a million files have been
created, my disk I/O speed significantly decreases. Additionally,
applications such as Task Manager cannot be executed. An error message pops
up indicating that the paged pool has been depleted. If I reboot the
machine, I can start creating new files again.
When I write the same amount of data to a single file (without opening or
closing new files), my application can run forever. This leads me to believe
that the leak occurs when opening and closing files.
The main loop of a small test application that I wrote to confirm that it is
not a problem with my code looks like this (where newfilename is unique
everytime through the loop):
while (true)
{
handle=CreateFile(newfilename, .... );
CloseHandle(handle);
}
Executing just those two lines over and over brings about the empty paged
pool symptoms. I have run poolmon.exe with this application running, and I
can see that the $Mft size and Mdl are growing rapidly in the non-paged pool,
and the MmSt paged pool tag was the big hitter in the paged pool.
Does anyone have any ideas of what is causing this? And maybe how I can
correct it?
Thanks,
Jake