Can i use more heap than 32 GB with compressed oops

前端 未结 5 497
被撕碎了的回忆
被撕碎了的回忆 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:53

    You can't have multiple heaps (you can have multiple JVMs though, which is called scaling out as opposed to scaling up).

    JVM uses compressed object pointers automatically below 32 GiB of memory. If you understand how it works (dropping youngest three bits from each address as they are always 0 due to memory alignment) you'll understand that you can't go further.

    There is an interesting fact: once you exceed this 32 GiB border JVM will stop using compressed object pointers, effectively reducing the available memory. That means increasing your JVM heap above 32 GiB you must go way above. According to great Everything I Ever Learned about JVM Performance Tuning @twitter (around 13:00) presentation increasing heap from 32 GiB to anything below 48 GiB will actually decrease the amount of available memory (!) because compressed object pointers are no longer there.

提交回复
热议问题