<div dir="ltr"><div dir="ltr">Hi Stefan,<div><br></div><div>Thank you for all of this information. FWIW, they're using the overcommit_memory setting because of this:</div><div><a href="https://www.postgresql.org/docs/current/kernel-resources.html#LINUX-MEMORY-OVERCOMMIT" target="_blank">https://www.postgresql.org/docs/current/kernel-resources.html#LINUX-MEMORY-OVERCOMMIT</a><br></div><div><br></div></div>Can you tell me how to know which GC is being used? They're on JDK 1.8 now and need to upgrade; I'm suggesting 17 just because I use it, but am open to anything. Anyway, they would install with 'dnf install java-17-openjdk' without any other setup, so I assume would use whatever the default is. (The only startup param we've been running with already is the -Xmx128m one.)<div><br></div><div>When I hear back about what happened with the other settings you have suggested I'll respond again here.</div><div><br></div><div>Thank you again for the help,</div><div>Bobby</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 29, 2023 at 5:06 AM Stefan Johansson <<a href="mailto:stefan.johansson@oracle.com" target="_blank">stefan.johansson@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Bobby,<br>
<br>
Generally I would not recommend running with "overcommit_memory=2", so <br>
if they can change that it would likely solve their issues. In the JVM <br>
many memory reservations (mmap) are using MAP_NORESERVE and this flag is <br>
ignored when overcommit_memory is 2. So most reservations will not only <br>
reserve virtual address space but also make sure it has backing.<br>
<br>
With this in mind reducing some default values might help. The <br>
compressed class space for example is 1G by default, and just running a <br>
"java -version" will reserve that space (and in your case back it up), <br>
so setting "-XX:CompressedClassSpaceSize=128m" might make sense.<br>
<br>
Another flag that could help is "-XX:ReservedCodeCacheSize", but the <br>
default size of that is platform depending. On my system it is 240m, and <br>
could be reduced a bit for smaller apps. Keep in mind that reducing <br>
those defaults, can come with other problems if the application needs <br>
space in those areas.<br>
<br>
Without more information, it is hard to give really good advice. If you <br>
can run with native memory tracking turned on we can see what the <br>
different sub-systems in the JVM use. Enable it like this:<br>
-XX:NativeMemoryTracking=summary -XX:+UnlockDiagnosticVMOptions <br>
-XX:+PrintNMTStatistics<br>
<br>
The print-flag will make the JVM print a summary upon exit. It is also <br>
possible to trigger this output using jcmd:<br>
jcmd <pid> VM.native_memory<br>
<br>
It would also be interesting to know which GC you use, G1 and CMS will <br>
use more memory compared to Parallel GC for example.<br>
<br>
Hope this helps,<br>
StefanJ<br>
<br>
<br>
On 2023-09-28 20:57, Bobby Bissett wrote:<br>
> Hi,<br>
> <br>
> I tried this question in another mailing list (I didn't know where it <br>
> belongs) and someone suggested I try here. If there's another list that <br>
> would be better suited, please let me know.<br>
> <br>
> A customer is running a Java application of ours that runs with -Xmx128m <br>
> -- there are no problems specifically with the heap. But the process is <br>
> using over 4 gig of VIRT(ual) memory according to 'top'. I didn't think <br>
> that was generally an issue, but they are running with <br>
> "overcommit_memory=2" on this linux system, and that 4 gig of memory is <br>
> hurting things. Is there a jvm parameter to help with this?<br>
> <br>
> FWIW, they're running openjdk 1.8. They need to upgrade to something <br>
> newer; if there's any particular version that might help with the <br>
> virtual memory it would be nice to know.<br>
> <br>
> Thank you,<br>
> Bobby Bissett<br>
> <br>
> <br>
> _______________________________________________<br>
> hotspot-gc-use mailing list<br>
> <a href="mailto:hotspot-gc-use@openjdk.org" target="_blank">hotspot-gc-use@openjdk.org</a><br>
> <a href="https://mail.openjdk.org/mailman/listinfo/hotspot-gc-use" rel="noreferrer" target="_blank">https://mail.openjdk.org/mailman/listinfo/hotspot-gc-use</a><br>
</blockquote></div>
</div></div>