JDK v6.0 이상에서 Compressed references 를 사용할때 Native OOM 이슈
1. WAS 버전 : WebSphere ND v7.0 이상 (JDK 64bit 사용시)
2. OS : 64bit
3. Error 발생 시점 : 64bit 의 JDK 를 사용하면서 -Xcompressedrefs 옵션(디폴트)을 이용하여 Compressed references 를
사용할때 Java Heap 의 free 가 많이 남아있음에도 불구하고 native OutOfMemory 이슈 발생
4. Error message :
Java core 상에 하단의 message 출력
Dump Event "systhrow" (00040000) Detail "java/lang/OutOfMemoryError" "native memory exhausted" received
Java core 상에 현재 running 중인 thread 가 ClassLoader 관련 class 가 보임
at java/lang/ClassLoader.defineClassImpl(Native Method)
at java/lang/ClassLoader.defineClass(ClassLoader.java:275(Compiled Code))
at com/ibm/ws/classloader/CompoundClassLoader.defineApplicationClass(CompoundClassLoader.java:615(Compiled Code))
at com/ibm/ws/ejbcontainer/jitdeploy/JITDeploy.generate_Tie(JITDeploy.java:323(Compiled Code))
5. 예상 이유 :
Compressed references 라는 방식 자체가 64bit 를 마치 32bit 처럼 압축해서 성능을 높이는 기술이므로 기술적인 한계상
native memory 를 0~4GB region 만 사용할 수 있습니다. (이는 32bit 의 memory reference 의 limit 과 동일한 값입니다. 2^32)
그런데 문제는 이 공간에 heap 이 같이 사용되면서 native memory 가 충분하더래도 native OOM 이 발생될 수 있습니다
6. 조치 방안 :
Native memory 를 4GB 모두 활용할 수 있도록 Java heap 의 base 위치를 -Xgc:preferredHeapBase=0xFFFE0000
옵션을 이용하여 명시적으로 지정
참조 : https://www-304.ibm.com/support/docview.wss?uid=swg1IZ73156