Shellong
Shellong

Reputation: 381

Difference between On-heap and Off-heap memory

Can someone explain the difference between on-heap memory and off-heap memory?Does the off-heap memory show on the JVM memory size?Are the off-heap all pointers?

Upvotes: 2

Views: 1718

Answers (1)

Peter Lawrey
Peter Lawrey

Reputation: 533820

All memory is native memory, however the JVM manages and record memory in it's JVM heap (not the same as the native heap)

Offheap is a Java term for memory not managed directly. However, it can be managed indirectly using direct ByteBuffer(s) as proxy objects for raw native memory.

Upvotes: 3

Related Questions