Opened 11 years ago

Closed 11 years ago

#1961 closed bug (invalid)

files downloaded or copied from CDs are saved to ram and are not sent to hardrive until shutdown

Reported by: qyellow Owned by: axeld
Priority: normal Milestone: R1
Component: Applications Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Running Revision 24470 on real hardware. When files are downloaded via webbrowser or svn etc the files take up immediate room in ram, this space is not released until the files created/downloaded are deleted. Same goes for anything copied from CDs, files go to ram and not harddrive. It seems the files are not written to the harddrive until Haiku is shutdown.

Change History (7)

comment:1 by ithamar, 11 years ago

did you try doing a sync from a Terminal? On shutdown/restart a sync is done automagicly. I think if you have enough memory the cached file data might stay in memory for quite a while....

comment:2 by anevilyak, 11 years ago

Component: - GeneralSystem/Kernel

I believe this is a known issue..there needs to be a thread that sweeps the cache periodically and writes back pages beyond a certain age. This may go hand in hand with needing a proper I/O scheduler.

comment:3 by bonefish, 11 years ago

Component: System/KernelApplications

There is a thread writing back changes to disk -- it's called "page writer" and does its job more or less well. The kernel uses all available memory for caching and releases that memory only when needed elsewhere. A "sync" will not free any memory; it will only write changes back to disk, still keeping the data in the cache.

When watching ProcessController during a Haiku session, particularly when working with many files, it will slowly and steadily (or sometimes even quickly) show an increasing memory usage until the memory bar is full and red. After that it will usually remain that way (unless you delete the cached files).

So, if the assumption that nothing is written to disk is only based on the fact that process controller from some point on always shows full memory, it is not correct. You can verify that by dropping into the kernel debugger and check the modified pages count the "page_stats" command prints.

ProcessController needs to be adjusted.

comment:4 by anevilyak, 11 years ago

Ah...thanks for the update, I didn't realize that was done. Is that by any chance why doing an svn checkout from within Haiku shows ~950MB in use in ProcessController afterwards?

in reply to:  4 comment:5 by bonefish, 11 years ago

Replying to anevilyak:

Ah...thanks for the update, I didn't realize that was done. Is that by any chance why doing an svn checkout from within Haiku shows ~950MB in use in ProcessController afterwards?

Not unlikely, if you checked out the Haiku sources. :-) If you "rm -r" everything afterwards, the memory usage should go back pretty much to what is was before the checkout. Not quite though, since some kernel allocations won't be freed (but rather marked unused).

comment:6 by qyellow, 11 years ago

I was wondering why deleting them freed that memory thanks for that info. The reason why I say it is only in memory is that if you just turn off the power to the computer instead of shutting down the files are not their on restart: specifically text documents/files copied over from CDs/sometimes preference files... and it can be awhile that they have been sitting there.

comment:7 by axeld, 11 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.