In Java, I have heard time and time again that too much memory can impact performance negatively. When I state memory, I am referencing virtual memory. Specifically I hear this more often than not when it comes to java -xmx
.
I understand assigning too much virtual memory and systems with a low amount of RAM, but other engineers I have talked with have told me that even on higher-powered machines, you still want to ensure xmx
is not overzealous. Is there a standard calculation everyone uses to determine this information such as on a 16GB machine you only use 1/4 for xmx
? 1/8th for page file? I ham having a hard time grasping why too much memory is a bad thing.
I have been searching all over the internet and so far my google-ninja skills have not been sufficient to find a good answer.
I have looked at Virtual Memory Usage from Java under Linux, too much memory used and this does not really appear to answer my question (or I am just slow and need to re-read it a couple of times). I understand that systems will pull a chunk of memory and reserve it for themselves and I understand increasing xmx
if out of memory errors are appearing.
My understanding is that xmx
should not just be given a higher memory number (ex. 8096) unless the application requires it. I fail to understand what is so bad about assigning (ex. 8096), even if the application runs fine with (ex. 4096) etc.