Setting -XX:MaxRam

后端 未结 3 1789
走了就别回头了
走了就别回头了 2020-12-18 21:26

According to this link, there is an option to set MaxRamSize manually to restrict the JVM to not use memory beyond this. But I have not seen any documentation of the same. I

3条回答
  •  一整个雨季
    2020-12-18 22:18

    I found the reference

    https://chriswhocodes.com/hotspot_options_jdk11.html?s=MaxRam

    But as Stephen C suggests it is probably just the B

    NOTE: This is the maximum RAM size used to calculate the default Heap and Direct memory maximum. It doesn't provide a greater enforcement.

    Real memory size (in bytes) used to set maximum heap size

    and for another parameter

    Maximum ergonomically set heap size (in bytes); [the default] zero means use MaxRAM * MaxRAMPercentage / 100


    In the Oracle/OpenJDK there is no obvious option.

    $ java -version -XX:+PrintFlagsFinal | grep -i MaxRAM
    

    However, on Linux you can set the maximum memory size with ulimit however this will hard crash the JVM if reached.

提交回复
热议问题