LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Question about page cache (https://www.linuxquestions.org/questions/programming-9/question-about-page-cache-4175461425/)

mina86 05-13-2013 11:53 AM

Quote:

Originally Posted by johnsfine (Post 4948824)
If a process has committed, but not used, a large amount of memory, then wants to commit more. It might fail due to lack of memory even though there is a large page cache (but not as large as the memory that process would have committed and unused). But if there were enough swap space free, that same request would not fail.

Ah, yes… I see what you're saying now. But in that scenario page cache actually does not matter, since it's counted as “free” memory either way. And also, if I'm reading the code correctly, the job would have to commit 97% of RAM+SWAP size for the scenario to occur.

Quote:

Originally Posted by rainman1985_2010 (Post 4949855)
My linux machine's "overcommit_memory" param is set to 0. Does this mean over commit rule is not working?

The opposite. It's “working” and 0 is the default value. (<http://lxr.linux.no/linux+*/include/uapi/linux/mman.h#L9>).

Quote:

Originally Posted by johnsfine (Post 4949459)
I think some process is trying to commit a very large chunk of memory and aborting because of the over commit rules.

I don't think that is the case. IIRC JVM will map however much memory has been configured for it and than manage memory on its own, so while JVM is running, memory allocation from within a Java program does not result in a new memory mapping, but simply of allocation of part of the virtual space that JVM has already prepared for all the objects.

sundialsvcs 05-16-2013 10:16 AM

Remember that, from the operating system's point of view, there is only one program running here: jvm.

That "one program" is of course designed to keep the operating-system informed of what it is doing and of what it requires. (It is a very well-engineered program, designed to withstand months or even years of continuous service.) But the (Linux) operating system never directly sees what your Java application is up to. It sees only JVM's behaviors (and its advice).


All times are GMT -5. The time now is 05:21 PM.