PDA

View Full Version : About File write operation



raghvendramisra
17th April 2008, 11:17
Hi all,
I have an application in whhich i have to contineously write binary data in a file.
This appliocation is to be run for more than one hour and so the file size will be more.

Now when i was running the application i found that my RAM space is contineously decreasing as i am performing the file operation and the system hangs once the RAM is full.

My doubt is that when the file write operation is done, is it first wriiten to RAM and then while closing the file it is copied to Harddisk or is some other way.?????????

how do i solve the problem.

Regards
Raghvendra

yosefm
17th April 2008, 11:41
The frequency of writing data back to the file is dependent on the operating system and the hard-disk driver, but at any case it uses the RAM only as a buffer; it shouldn't fill up the RAM.

My guess is that you keep everything in memory after you wrote it, instead of discarding written data. You might have another kind of memory leak. At any rate, I don't think it's the writing to disk that hangs your system.