Re: Non-paged pool memory leak in when huge number of files is created
- From: Vladimir Zinin <vzinin@xxxxxxxxx>
- Date: Tue, 08 Aug 2006 12:25:18 +0300
It's most likely not a memory leak. Usually file systems do not delete immediately at the file closing process the internal data structures which have been created for support of work with the opened files. Counting upon that the same files will be open again in the near future.
--
Best regards,
Vladimir Zinin
mailto:vzinin@xxxxxxxxx
Jasen Kolev wrote:
We have found a problem in XP SP2 witch is concludes in huge non-paged memory leak, when process creates huge number in files. Process is a program that works as a “black-box” and writes small amount of data in different files similar to next simple code written in C:.
/*--------------------------------------------------------
//Program 10 times creates 10000 files 4KB each //Each time deletes previously created 10000 files
// last 10000 files are left in dir
*/
#include <stdio.h>
char buf[4096];
void main(void)
{
FILE *f;
char filename[80];
int i,j;
for ( j=0; j<10 ;j++){
for(i=0;i<10000;i++){
sprintf(filename,"c:\\temp\\t%02d-%06d.bin",j,i);
f=fopen(filename,"w+b");
fwrite(buf,sizeof(char),4096,f);
fflush(f);
fclose(f);
}
if (0!=j)
for(i=0;i<10000;i++){
sprintf(filename,"c:\\temp\\t%02d-%06d.bin",j-1,i);
remove(filename);
}
}
}
/*----------------------------------------------*/
We try this with several different VC6, VC2003,VC2005 also in C# and similar program using pure Windows API, same efect. We also run this program on different hrdware configurations.
- Prev by Date: Re: waveInOpen and waveOutOpen return MMSYSERR_ALLOCATED
- Next by Date: SetWindowsHooksEx
- Previous by thread: Winsock Transport Service Provider
- Next by thread: Re: Non-paged pool memory leak in when huge number of files is cre
- Index(es):
Relevant Pages
|