-Xcheck:jni

All

The usage of this JVM flag is for as memory checks or checks on JNI functions.

This flag sometimes, depending on the function, it shows many warnings.

Check:jni, helps to debug applications that use the Java Native Interface (JNI).

java -Xcheck:jni -verbose:jni TestJNI
 execve("/jdk-11.0.1/bin/java", ["/jdk-11."…, "-Xcheck:jni", "-verbose:jni", "TestJNI"], 0x7ffd7b68e388 /* 72 vars */) = 0
 brk(NULL)                               = 0xb48000
 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fda7bdff000
 readlink("/proc/self/exe", "/jdk-11."…, 4096) = 44
 access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
 open("/jdk-11.0.1/bin/../lib/jli/tls/x86_64/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
 stat("/jdk-11.0.1/bin/../lib/jli/tls/x86_64", 0x7fff832f29b0) = -1 ENOENT (No such file or directory)
 open("/jdk-11.0.1/bin/../lib/jli/tls/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
 stat("/jdk-11.0.1/bin/../lib/jli/tls", 0x7fff832f29b0) = -1 ENOENT (No such file or directory)
 open("/jdk-11.0.1/bin/../lib/jli/x86_64/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
 stat("/jdk-11.0.1/bin/../lib/jli/x86_64", 0x7fff832f29b0) = -1 ENOENT (No such file or directory)
 open("/jdk-11.0.1/bin/../lib/jli/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
 stat("/jdk-11.0.1/bin/../lib/jli", {st_mode=S_IFDIR|0775, st_size=1024, …}) = 0
 open("/jdk-11.0.1/bin/../lib/tls/x86_64/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

And of course the check part:

mmap(NULL, 1052672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7fda7bcdc000
 clone(child_stack=0x7fda7bddbfb0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7fda7bddc9d0, tls=0x7fda7bddc700, child_tidptr=0x7fda7bddc9d0) = 3660
 futex(0x7fda7bddc9d0, FUTEX_WAIT, 3660, NULLChecked JNI functions are being used to validate JNI usage
 [Dynamic-linking native method java.lang.Object.registerNatives … JNI]
 [Registering JNI native method java.lang.Object.hashCode]
 [Registering JNI native method java.lang.Object.wait]
 [Registering JNI native method java.lang.Object.notify]
 [Registering JNI native method java.lang.Object.notifyAll]
 [Registering JNI native method java.lang.Object.clone]
 [Dynamic-linking native method java.lang.System.registerNatives … JNI]
 [Registering JNI native method java.lang.System.currentTimeMillis]
 [Registering JNI native method java.lang.System.nanoTime]
 [Registering JNI native method java.lang.System.arraycopy]
 [Dynamic-linking native method java.lang.Class.registerNatives … JNI]
 [Registering JNI native method java.lang.Class.getName0]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s