Can i use more heap than 32 GB with compressed oops

前端 未结 5 498
被撕碎了的回忆
被撕碎了的回忆 2020-12-31 13:06

I could understand that with compressed oops , we can only use 32 GB of RAM. Is there someway i can use more than that like by allocating 2 heap or something ?

Thank

5条回答
  •  说谎
    说谎 (楼主)
    2020-12-31 13:31

    You can use larger heap sizes with an additional parameter: -XX:ObjectAlignmentInBytes=alignment

    This parameter is a fixed adjustment of Java objects. The default value is 8 (bytes). The indicated value has to be a power of two, and ranges from 8 to 256.

    The heap size limit in bytes is calculated as:

    4GB * ObjectAlignmentInBytes
    

    A 64GB heap size will be available for compressed pointers with the following line:

    -XX:ObjectAlignmentInBytes=16
    

    There is a note to be considered in the documentation for larger heap sizes though:

    Note: As the alignment value increases, the unused space between objects will also increase. As a result, you may not realize any benefits from using compressed pointers with large Java heap sizes.

提交回复
热议问题