我们有一个使用这些选项运行的 Java 17 应用程序:
-Xmx100g
-XX:+UseZGC
运行时出现这些gc警告:
[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.
几个小时后,通过应用程序增加堆使用率(大约 ~
60gb
),它遇到 OOM 并崩溃。
基于以上警告:
184320 = 1.8 * 102400
;我也试过其他Xmx
值,公式是:
vm.max_map_count = 1.8 * xmx_in_mb
我的问题:
ZGC
和vm.max_map_count
有什么关系?我找不到任何关于它的官方文档?