0

We have a java 17 application which run with theses options:

-Xmx100g
-XX:+UseZGC

When running it, these gc warnings appear:

[warning][gc] 
***** WARNING! INCORRECT SYSTEM CONFIGURATION DETECTED! *****
The system limit on number of memory mappings per process might be too low for the given
max Java heap size (102400M). Please adjust /proc/sys/vm/max_map_count to allow for at
least 184320 mappings (current limit is 65530). Continuing execution with the current
limit could lead to a premature OutOfMemoryError being thrown, due to failure to map memory.

And after a few hours, by increasing heap usage (about ~ 60gb), application encountered OOM and crashed.

Based on the above warning: 184320 = 1.8 * 102400; Also i'v tried other Xmx values, the formula is:

vm.max_map_count = 1.8 * xmx_in_mb

My questions:

  1. What is the relation of ZGC and vm.max_map_count? I can't find any official documentation about it!
  2. Is it safe to use the above formula?
Arya
  • 2,809
  • 5
  • 34
  • 56
  • You asked almost the same question before? https://stackoverflow.com/q/75713808/1362755 Also... why not just try it and see whether it works? – the8472 Mar 19 '23 at 16:29
  • Yes i've tried it. But no, its not the same question. – Arya Mar 21 '23 at 08:17
  • Point 1 "What is the relation of ZGC and vm.max_map_count?" and "my question is what exactly has been changed in java or GC which causes these warnings and eventually these errors?" ... are quite similar in my eyes. And the answer would be the same, ZGC simply needs more of that resource, that's their relation. Also, how are big fat warning messages not documentation? – the8472 Mar 21 '23 at 17:12

0 Answers0