Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The JVM is blissfully unaware of the underlaying OS memory management. I remember attending a JavaOne session about GC optimization not long ago and the speaker emphasized that you should always ensure that there is plenty of free memory (RAM, not swap) for the JVM to run, as to avoid paging at all costs, so never assign more memory to the JVM than what you have available at a given time in your system. Even more so, because of the way some GC collection algorithms work, it could have a huge performance penalty if the memory blocks they are collecting are paged. </p> <p>So never give more memory to the JVM than what you have physically available in your system or if you expect memory consumption to increase over time because of some external processes then assign a heap space that will ensure that it will never be paged. And if you can't satisfy these conditions, well then you need more RAM :)</p> <p>Update: did a little searching in SO and I found <a href="https://stackoverflow.com/questions/862761/jvm-garbage-collection-and-a-paging-memory-architecture">this</a>. Here kdgregory argues that paging shouldn't be an issue because of the way GC works, but he is considering paging due to normal conditions, i.e. memory not being touched for a while, which is not your case, because you would be running out of memory and you will definitely start paging. Also, in case you are running some Linux flavor check John Ferminella's answer and his <a href="http://distilledb.com/blog/archives/date/2009/02/22/swap-files-in-linux.page" rel="nofollow noreferrer">great blog post</a> explaining how to understand and tune the swap in Linux.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload