Java using more memory than the allocated memory

后端 未结 2 400
傲寒
傲寒 2020-12-09 21:50

An Apache Tomcat (Atlassian Confluence) instance is started using the following Java options:

JAVA_OPTS=\"-Xms256m -Xmx512m -XX:MaxPermSize=256m -Djava.awt.h         


        
相关标签:
2条回答
  • 2020-12-09 22:23

    For example, a native library can easily allocate memory outside Java heap.

    Direct ByteBuffer also does that: http://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html

    The contents of direct buffers may reside outside of the normal garbage-collected heap, and so their impact upon the memory footprint of an application might not be obvious.

    There are good reasons to allocate huge direct ByteBuffers.

    http://ehcache.org/documentation/offheap_store.html

    0 讨论(0)
  • 2020-12-09 22:30

    Total Tomcat memory consumption should be calculated at NO LESS THAN Xmx + XX:MaxPermSize (in your case, 768MB), but I do recall seeing somewhere that it can go over that. Xmx is only the heap space, and PermGen is outside the heap (kind of).

    0 讨论(0)
提交回复
热议问题