Which virtual machines or controllers support JNI?

Get<PrimitiveType>ArrayElementsa family of functions is documented either to copy arrays or to fix them (and at the same time prevent them from moving the garbage collector). It is documented as a safer, less restrictive alternative GetPrimitiveArrayCritical. However, I would like to know which virtual machines and / or garbage collectors (if any) actually connect the arrays rather than copy them.

+4
source share
1 answer

Old IBM JVMs are pinned (1.4 and earlier - that is: NOT the current IBM J9 JVM), but they have not done so since. In general, JVMs do not like to commit, as it really confuses the copying of garbage collectors, which is what most modern JVMs do. I am not 100% up to today (that is: the latest versions of Java 7), but historically HotSpot has not been either (for the same reasons generating GC).

Keep in mind: the JVM, which may be on the board today, may not be tomorrow, and vice versa, so you need to write your code to process it in both directions, as the basic Java libraries do.

+7
source

All Articles