Memory leak and file IO perfromance problems in C++

G

Geoff

I have a problem while streaming data to file at high speed. The problem is
demonstrated by
writing a simple program in either C or C++ that simply writes a buffer of
random data to file using fwrite or FileWrite or any standard method for
writing a data buffer to disc. You need to create files of quite a large
size and monitor the memory usage of the machine over time. On windows 2000
or XP you will notice a small memory leak of approx 4kbytes/sec. As time
goes on the IO performance to disc also degrades i.e. gets slower.

Has any body else found the same ? Is there a bug in the OS / kernal code of
2000 & XP. I've noticed that if you do the same thing on Windows NT, the
memory usage rises until approx 5Mbytes of RAM are used, then the RAM is
released and this cycle keeps going and leads to no long term loss of IO
performance. This is not true under 2000 & XP, as far as I can ascertain the
memory is never recycled and IO performance degrades significantly.

At first I thought it might be due to the disk filling up. So I filled the
disc by creating hundreds of smaller files. There was no memory leak and no
term degradation of IO performance. At each file closure memory was released
by the IO sub-system and IO performance returned to that at start of
streaming. So it's not due to the disc filling up, I conclude that it is
related to the memory loss of the IO sub-system.

Anybody got any information ?

Much thanks for any help ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top