转)Understanding Java Memory Management

Understanding Java Memory Management - IBM

Java Native Interface (JNI) Objects and Code

Java Native Interface code can directly allocate native memory using system calls:

– malloc, calloc, realloc etc.

Uses memory from the memory from the process address space

– Just like the Java heap does

Some Java Class Library code uses JNI, and therefore allocates native memory

– java.lang.Class

– java.lang.Thread

– java.net.Socket

– java.util.ZipFile

– java.nio.ByteBuffer (if allocated as direct)

Objects that use small amount of Java heap, may use much larger quantities of native memory

– Classes, Threads and (direct) ByteBuffers are good examples

Example: java.lang.Class objects

Example: java.lang.Class objects

posted @ 2019-09-08 14:40  eycuii  阅读(328)  评论(0编辑  收藏  举报