티스토리 뷰

카테고리 없음

JVM OOPS(Ordinary object pointer)

아빠악어. 2016. 9. 1. 00:14

https://blog.codecentric.de/en/2014/02/35gb-heap-less-32gb-java-jvm-memory-oddities/


1. JVM 사용시 Heap에 32GB 이상 할당 하지 말라.


2. 32bit 시스템에서는 Object 할당을 4GB 안에서 하지만 64bit 시스템에서는 2^64-1 byte, 18.5 Exabyte에서 할당 할 수 있다.


3. 메모리 주소값이 너무 큰만큼 Object 할당 및 계산에 비효율이 발생


4. 그래서 만든것이 CompressedOops

자세한건 여기서 참고 하시라 (https://wiki.openjdk.java.net/display/HotSpot/CompressedOops)


5. 동작 원리는 메모리 영역중 일부는 사용하지 않고 8byte 스키마를 사용, 0 8 16 24의 비트 영역을 사용한다. 왼쪽 쉬프트 3번 하면 간단하게 계산 된다 >

원문 참고 : Because the JVM memory layout uses a 8byte addressing scheme, which means that objects can be at address 0, 8, 16, 24… but not at 2, 7 or any other non multiple of 8, compressed oops just address the virtual positions 0, 1, 2, 3 instead of the real ones 0, 8, 16, 24. To get from the compressed address to the real one, the JVM needs just to left shift it 3 times. Easy.


6. 그러면 최대 할당 할 수 있는 크기는 32GB


7. JVM에서 32GB 이상으로 할당하면 compressed oops feature가 꺼진다. 


8. 40~50GB의 heap을 할당하는것 보다 32GB + compressed oops 성능이 더 좋다고 한다.


9 그 이상의 할당은 STW가 길어져서 두렵지 않을까?

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함