Iranna Patil
Apr 3, 2022

You are right, JVM is moving away from using libraries from c/c++ to do internal work using JNI to have them built in JAVA space, so new keyword will be allocating from the memory slabs by advancing the pointer in most of the JVM's.

But JVM still uses native calls to allocate memories and even those slabs.

example: if you look the java internal jdk.internal.misc.Unsafe memory allocation method it still calls native allocator from c/c++ shared library.

private native long allocateMemory0(long bytes);

Iranna Patil
Iranna Patil

No responses yet