User: Password:
|
|
Subscribe / Log in / New account

Temporary files: RAM or disk?

Temporary files: RAM or disk?

Posted Jun 3, 2012 1:55 UTC (Sun) by Cyberax (✭ supporter ✭, #52523)
In reply to: Temporary files: RAM or disk? by giraffedata
Parent article: Temporary files: RAM or disk?

The problem is, swap allows to allocate more RAM than present, using disk as a backing storage. Usually it works just fine because you don't need to touch all of your RAM at the same time.

However, there are several pathological cases that can arise. One depressingly common case: a fairly inactive application (say, a Java webapp) with a large working set is slowly pushed into swap by other apps. Since application is inactive it lives just fine until something triggers a garbage collection. And then JVM has to walk through all the pages, tracing object references and that causes all of the working set to be brought into RAM.

And while app is swapping in, the system might appear to be locked - I have no idea why, in theory other apps should remain responsive.

As a bonus, in this scenario the swapin of a Java application might cause swap out of another application which might be active at that time, causing problems with response time.

And as additional bonus, there's an even simpler scenario - an application which constantly allocates RAM (perhaps, in an infinite loop of malloc). It reliably kills my machine for several minutes if I use swap.


(Log in to post comments)

Temporary files: RAM or disk?

Posted Jun 4, 2012 13:09 UTC (Mon) by nix (subscriber, #2304) [Link]

And while app is swapping in, the system might appear to be locked - I have no idea why, in theory other apps should remain responsive.
Possibly part of the X server has been pushed out to swap, leaving it unable to dispatch events without swapping itself back in off the already-highly-contended disk.

Temporary files: RAM or disk?

Posted Jun 5, 2012 14:29 UTC (Tue) by pboddie (guest, #50784) [Link]

And let us not forget that valuable property of the OOM killer who usually makes an entrance at this point: to kill all the desired applications, leaving stupidapp to finally emerge triumphant, only to exclaim, "Where did everybody go?! System is going down for reboot? What does that mean?!"


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds