如何判断 JDK 17 应用程序启动时 JVM 实际加载了哪些 JNI 库?

问题描述 投票:0回答:2

我使用 JVM 选项启动我的应用程序

-Xlog:library=trace
- 基于另一个问题中的建议 - 查看正在加载哪些本机库。

但是输出非常混乱 - 见下文:

[0.021s][info][library] Loaded library libjsvml.so, handle 0x00007f9a7c0ca000
[0.042s][info][library] Failed to find JNI_OnLoad_nio in library with handle 0x00007f9a83c232e0
[0.045s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libnio.so, handle 0x00007f9a7c0eccb0
[0.046s][info][library] Found JNI_OnLoad in library with handle 0x00007f9a7c0eccb0
[0.046s][info][library] Found Java_sun_nio_fs_UnixNativeDispatcher_init in library with handle 0x00007f9a7c0eccb0
[0.047s][info][library] Found Java_sun_nio_fs_UnixNativeDispatcher_getcwd in library with handle 0x00007f9a7c0eccb0
[0.049s][info][library] Found Java_sun_nio_fs_UnixNativeDispatcher_stat0 in library with handle 0x00007f9a7c0eccb0
[0.052s][info][library] Failed to find JNI_OnLoad_zip in library with handle 0x00007f9a83c232e0
[0.053s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libzip.so, handle 0x00007f9a7c024da0
[0.054s][info][library] Found JNI_OnLoad in library with handle 0x00007f9a7c024da0
[0.054s][info][library] Failed to find Java_java_util_zip_Inflater_initIDs in library with handle 0x00007f9a7c0eccb0
[0.055s][info][library] Found Java_java_util_zip_Inflater_initIDs in library with handle 0x00007f9a7c024da0
[0.056s][info][library] Failed to find Java_java_util_zip_Inflater_init in library with handle 0x00007f9a7c0eccb0
[0.057s][info][library] Found Java_java_util_zip_Inflater_init in library with handle 0x00007f9a7c024da0
[0.063s][info][library] Failed to find Java_java_util_zip_Inflater_inflateBytesBytes in library with handle 0x00007f9a7c0eccb0
[0.067s][info][library] Found Java_java_util_zip_Inflater_inflateBytesBytes in library with handle 0x00007f9a7c024da0
[0.068s][info][library] Failed to find Java_java_util_zip_Inflater_reset in library with handle 0x00007f9a7c0eccb0
[0.069s][info][library] Found Java_java_util_zip_Inflater_reset in library with handle 0x00007f9a7c024da0
[0.074s][info][library] Failed to find JNI_OnLoad_zip in library with handle 0x00007f9a83c232e0
[0.117s][info][library] Failed to find Java_java_util_zip_Inflater_end in library with handle 0x00007f9a7c0eccb0
[0.117s][info][library] Found Java_java_util_zip_Inflater_end in library with handle 0x00007f9a7c024da0
[0.211s][info][library] Failed to find JNI_OnLoad_jimage in library with handle 0x00007f9a83c232e0
[0.213s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libjimage.so, handle 0x00007f9a7c002790
[0.216s][info][library] Failed to find JNI_OnLoad in library with handle 0x00007f9a7c002790
[0.220s][info][library] Failed to find Java_jdk_internal_jimage_NativeImageBuffer_getNativeMap in library with handle 0x00007f9a7c0eccb0
[0.221s][info][library] Failed to find Java_jdk_internal_jimage_NativeImageBuffer_getNativeMap in library with handle 0x00007f9a7c024da0
[0.222s][info][library] Found Java_jdk_internal_jimage_NativeImageBuffer_getNativeMap in library with handle 0x00007f9a7c002790
[0.531s][info][library] Failed to find JNI_OnLoad_net in library with handle 0x00007f9a83c232e0
[0.532s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libnet.so, handle 0x00007f9a7c0ed2f0
[0.533s][info][library] Found JNI_OnLoad in library with handle 0x00007f9a7c0ed2f0
[0.534s][info][library] Found inet_pton in library with handle 0x0000000000000000
[0.534s][info][library] Failed to find JNI_OnLoad_nio in library with handle 0x00007f9a83c232e0
[0.535s][info][library] Found Java_sun_nio_ch_IOUtil_initIDs in library with handle 0x00007f9a7c0eccb0
[0.536s][info][library] Found Java_sun_nio_ch_IOUtil_iovMax in library with handle 0x00007f9a7c0eccb0
[0.536s][info][library] Found Java_sun_nio_ch_FileChannelImpl_initIDs in library with handle 0x00007f9a7c0eccb0
[0.537s][info][library] Found Java_sun_nio_ch_FileChannelImpl_maxDirectTransferSize0 in library with handle 0x00007f9a7c0eccb0
[0.538s][info][library] Found Java_sun_nio_ch_FileDispatcherImpl_init in library with handle 0x00007f9a7c0eccb0
[0.538s][info][library] Found Java_sun_nio_ch_NativeThread_init in library with handle 0x00007f9a7c0eccb0
[0.539s][info][library] Found Java_sun_nio_ch_NativeThread_current in library with handle 0x00007f9a7c0eccb0
[0.540s][info][library] Found Java_sun_nio_ch_FileKey_initIDs in library with handle 0x00007f9a7c0eccb0
[0.541s][info][library] Found Java_sun_nio_ch_FileKey_init in library with handle 0x00007f9a7c0eccb0
[0.542s][info][library] Found Java_sun_nio_ch_FileDispatcherImpl_lock0 in library with handle 0x00007f9a7c0eccb0
[0.542s][info][library] Found Java_sun_nio_ch_FileDispatcherImpl_release0 in library with handle 0x00007f9a7c0eccb0
[0.543s][info][library] Failed to find JNI_OnLoad_native-platform in library with handle 0x00007f9a83c232e0
[0.544s][info][library] Loaded library /root/.gradle/native/e1d6ef7f7dcc3fd88c89a11ec53ec762bb8ba0a96d01ffa2cd45eb1d1d8dd5c5/linux-amd64/libnative-platform.so, handle 0x00007f9a7c6cad60
[0.545s][info][library] Found JNI_OnLoad in library with handle 0x00007f9a7c6cad60
[0.546s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_NativeLibraryFunctions_getVersion in library with handle 0x00007f9a7c6cad60
[0.552s][info][library] Failed to find JNI_OnLoad_native-platform-curses in library with handle 0x00007f9a83c232e0
[0.557s][info][library] Failed to find JNI_OnLoad_native-platform-curses in library with handle 0x00007f9a83c232e0
[0.560s][info][library] Loaded library /root/.gradle/native/e1d6ef7f7dcc3fd88c89a11ec53ec762bb8ba0a96d01ffa2cd45eb1d1d8dd5c5/linux-amd64-ncurses6/libnative-platform-curses.so, handle 0x00007f9a7c6d0ef0
[0.561s][info][library] Failed to find JNI_OnLoad in library with handle 0x00007f9a7c6d0ef0
[0.562s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_getVersion in library with handle 0x00007f9a7c6d0ef0
[0.565s][info][library] Failed to find Java_net_rubygrapefruit_platform_internal_jni_PosixTerminalFunctions_isatty in library with handle 0x00007f9a7c6d0ef0
[0.565s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_PosixTerminalFunctions_isatty in library with handle 0x00007f9a7c6cad60
[0.567s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_initTerminal in library with handle 0x00007f9a7c6d0ef0
[0.568s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_hideCursor in library with handle 0x00007f9a7c6d0ef0
[0.568s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_showCursor in library with handle 0x00007f9a7c6d0ef0
[0.570s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_defaultForeground in library with handle 0x00007f9a7c6d0ef0
[0.571s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_boldOn in library with handle 0x00007f9a7c6d0ef0
[0.571s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_dimOn in library with handle 0x00007f9a7c6d0ef0
[0.572s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_reset in library with handle 0x00007f9a7c6d0ef0
[0.572s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_down in library with handle 0x00007f9a7c6d0ef0
[0.573s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_up in library with handle 0x00007f9a7c6d0ef0
[0.574s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_left in library with handle 0x00007f9a7c6d0ef0
[0.574s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_right in library with handle 0x00007f9a7c6d0ef0
[0.575s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_startLine in library with handle 0x00007f9a7c6d0ef0
[0.575s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_clearToEndOfLine in library with handle 0x00007f9a7c6d0ef0
[0.666s][info][library] Failed to find JNI_OnLoad_management in library with handle 0x00007f9a83c232e0
[0.667s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libmanagement.so, handle 0x00007f9a7c763730
[0.668s][info][library] Found JNI_OnLoad in library with handle 0x00007f9a7c763730
[0.669s][info][library] Failed to find JNI_OnLoad_management_ext in library with handle 0x00007f9a83c232e0
[0.670s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libmanagement_ext.so, handle 0x00007f9a7c76e760
[0.671s][info][library] Found JNI_OnLoad in library with handle 0x00007f9a7c76e760
[0.673s][info][library] Failed to find Java_sun_management_VMManagementImpl_getVersion0 in library with handle 0x00007f9a7c76e760
[0.674s][info][library] Failed to find Java_sun_management_VMManagementImpl_getVersion0 in library with handle 0x00007f9a7c0eccb0
[0.674s][info][library] Found Java_sun_management_VMManagementImpl_getVersion0 in library with handle 0x00007f9a7c763730
[0.675s][info][library] Failed to find Java_sun_management_VMManagementImpl_initOptionalSupportFields in library with handle 0x00007f9a7c76e760
[0.675s][info][library] Failed to find Java_sun_management_VMManagementImpl_initOptionalSupportFields in library with handle 0x00007f9a7c0eccb0
[0.676s][info][library] Found Java_sun_management_VMManagementImpl_initOptionalSupportFields in library with handle 0x00007f9a7c763730
[0.682s][info][library] Failed to find Java_sun_management_VMManagementImpl_getStartupTime in library with handle 0x00007f9a7c76e760
[0.683s][info][library] Failed to find Java_sun_management_VMManagementImpl_getStartupTime in library with handle 0x00007f9a7c0eccb0
[0.684s][info][library] Found Java_sun_management_VMManagementImpl_getStartupTime in library with handle 0x00007f9a7c763730
[0.687s][info][library] Failed to find Java_sun_management_VMManagementImpl_getVmArguments0 in library with handle 0x00007f9a7c76e760
[0.687s][info][library] Failed to find Java_sun_management_VMManagementImpl_getVmArguments0 in library with handle 0x00007f9a7c0eccb0
[0.687s][info][library] Found Java_sun_management_VMManagementImpl_getVmArguments0 in library with handle 0x00007f9a7c763730
[0.702s][info][library] Failed to find Java_net_rubygrapefruit_platform_internal_jni_PosixProcessFunctions_getPid in library with handle 0x00007f9a7c6d0ef0
[0.703s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_PosixProcessFunctions_getPid in library with handle 0x00007f9a7c6cad60
[0.782s][info][library] Failed to find JNI_OnLoad_net in library with handle 0x00007f9a83c232e0
[0.782s][info][library] Failed to find Java_java_net_NetworkInterface_init in library with handle 0x00007f9a7c76e760
[0.784s][info][library] Found Java_java_net_NetworkInterface_init in library with handle 0x00007f9a7c0eccb0
[0.785s][info][library] Failed to find JNI_OnLoad_net in library with handle 0x00007f9a83c232e0
[0.786s][info][library] Failed to find Java_java_net_InetAddress_init in library with handle 0x00007f9a7c76e760
[0.787s][info][library] Found Java_java_net_InetAddress_init in library with handle 0x00007f9a7c0eccb0
[0.789s][info][library] Failed to find Java_java_net_InetAddressImplFactory_isIPv6Supported in library with handle 0x00007f9a7c76e760
[0.789s][info][library] Found Java_java_net_InetAddressImplFactory_isIPv6Supported in library with handle 0x00007f9a7c0eccb0
[0.790s][info][library] Failed to find Java_java_net_Inet4Address_init in library with handle 0x00007f9a7c76e760
[0.790s][info][library] Found Java_java_net_Inet4Address_init in library with handle 0x00007f9a7c0eccb0
[0.791s][info][library] Failed to find Java_java_net_Inet6Address_init in library with handle 0x00007f9a7c76e760
[0.791s][info][library] Found Java_java_net_Inet6Address_init in library with handle 0x00007f9a7c0eccb0
[0.792s][info][library] Failed to find Java_java_net_NetworkInterface_getAll in library with handle 0x00007f9a7c76e760
[0.793s][info][library] Found Java_java_net_NetworkInterface_getAll in library with handle 0x00007f9a7c0eccb0
[0.798s][info][library] Failed to find Java_java_net_NetworkInterface_isLoopback0 in library with handle 0x00007f9a7c76e760
[0.803s][info][library] Found Java_java_net_NetworkInterface_isLoopback0 in library with handle 0x00007f9a7c0eccb0
[0.804s][info][library] Failed to find Java_java_net_NetworkInterface_boundInetAddress0 in library with handle 0x00007f9a7c76e760
[0.804s][info][library] Found Java_java_net_NetworkInterface_boundInetAddress0 in library with handle 0x00007f9a7c0eccb0
[0.806s][info][library] Failed to find JNI_OnLoad_extnet in library with handle 0x00007f9a83c232e0
[0.807s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libextnet.so, handle 0x00007f9a7c7e4fd0
[0.807s][info][library] Found JNI_OnLoad in library with handle 0x00007f9a7c7e4fd0
[0.808s][info][library] Found Java_jdk_net_LinuxSocketOptions_quickAckSupported0 in library with handle 0x00007f9a7c7e4fd0
[0.809s][info][library] Found Java_jdk_net_LinuxSocketOptions_keepAliveOptionsSupported0 in library with handle 0x00007f9a7c7e4fd0
[0.809s][info][library] Found Java_jdk_net_LinuxSocketOptions_incomingNapiIdSupported0 in library with handle 0x00007f9a7c7e4fd0
[0.810s][info][library] Failed to find Java_sun_nio_ch_Net_initIDs in library with handle 0x00007f9a7c7e4fd0
[0.810s][info][library] Failed to find Java_sun_nio_ch_Net_initIDs in library with handle 0x00007f9a7c76e760
[0.811s][info][library] Found Java_sun_nio_ch_Net_initIDs in library with handle 0x00007f9a7c0eccb0
[0.811s][info][library] Failed to find Java_sun_nio_ch_Net_pollinValue in library with handle 0x00007f9a7c7e4fd0
[0.812s][info][library] Failed to find Java_sun_nio_ch_Net_pollinValue in library with handle 0x00007f9a7c76e760
[0.812s][info][library] Found Java_sun_nio_ch_Net_pollinValue in library with handle 0x00007f9a7c0eccb0
[0.813s][info][library] Failed to find Java_sun_nio_ch_Net_polloutValue in library with handle 0x00007f9a7c7e4fd0
[0.813s][info][library] Failed to find Java_sun_nio_ch_Net_polloutValue in library with handle 0x00007f9a7c76e760
[0.814s][info][library] Found Java_sun_nio_ch_Net_polloutValue in library with handle 0x00007f9a7c0eccb0
[0.814s][info][library] Failed to find Java_sun_nio_ch_Net_pollerrValue in library with handle 0x00007f9a7c7e4fd0
[0.815s][info][library] Failed to find Java_sun_nio_ch_Net_pollerrValue in library with handle 0x00007f9a7c76e760
[0.815s][info][library] Found Java_sun_nio_ch_Net_pollerrValue in library with handle 0x00007f9a7c0eccb0
[0.816s][info][library] Failed to find Java_sun_nio_ch_Net_pollhupValue in library with handle 0x00007f9a7c7e4fd0
[0.816s][info][library] Failed to find Java_sun_nio_ch_Net_pollhupValue in library with handle 0x00007f9a7c76e760
[0.820s][info][library] Found Java_sun_nio_ch_Net_pollhupValue in library with handle 0x00007f9a7c0eccb0
[0.820s][info][library] Failed to find Java_sun_nio_ch_Net_pollnvalValue in library with handle 0x00007f9a7c7e4fd0
[0.823s][info][library] Failed to find Java_sun_nio_ch_Net_pollnvalValue in library with handle 0x00007f9a7c76e760
[0.827s][info][library] Found Java_sun_nio_ch_Net_pollnvalValue in library with handle 0x00007f9a7c0eccb0
[0.827s][info][library] Failed to find Java_sun_nio_ch_Net_pollconnValue in library with handle 0x00007f9a7c7e4fd0
[0.828s][info][library] Failed to find Java_sun_nio_ch_Net_pollconnValue in library with handle 0x00007f9a7c76e760
[0.829s][info][library] Found Java_sun_nio_ch_Net_pollconnValue in library with handle 0x00007f9a7c0eccb0
[0.829s][info][library] Failed to find Java_sun_nio_ch_Net_isExclusiveBindAvailable in library with handle 0x00007f9a7c7e4fd0
[0.830s][info][library] Failed to find Java_sun_nio_ch_Net_isExclusiveBindAvailable in library with handle 0x00007f9a7c76e760
[0.831s][info][library] Found Java_sun_nio_ch_Net_isExclusiveBindAvailable in library with handle 0x00007f9a7c0eccb0
[0.831s][info][library] Failed to find Java_sun_nio_ch_Net_isIPv6Available0 in library with handle 0x00007f9a7c7e4fd0
[0.832s][info][library] Failed to find Java_sun_nio_ch_Net_isIPv6Available0 in library with handle 0x00007f9a7c76e760
[0.832s][info][library] Found Java_sun_nio_ch_Net_isIPv6Available0 in library with handle 0x00007f9a7c0eccb0
[0.833s][info][library] Failed to find Java_sun_nio_ch_Net_socket0 in library with handle 0x00007f9a7c7e4fd0
[0.833s][info][library] Failed to find Java_sun_nio_ch_Net_socket0 in library with handle 0x00007f9a7c76e760
[0.837s][info][library] Found Java_sun_nio_ch_Net_socket0 in library with handle 0x00007f9a7c0eccb0
[0.843s][info][library] Failed to find Java_sun_nio_ch_IOUtil_setfdVal in library with handle 0x00007f9a7c7e4fd0
[0.843s][info][library] Failed to find Java_sun_nio_ch_IOUtil_setfdVal in library with handle 0x00007f9a7c76e760
[0.844s][info][library] Found Java_sun_nio_ch_IOUtil_setfdVal in library with handle 0x00007f9a7c0eccb0
[0.844s][info][library] Failed to find Java_sun_nio_ch_IOUtil_fdVal in library with handle 0x00007f9a7c7e4fd0
[0.845s][info][library] Failed to find Java_sun_nio_ch_IOUtil_fdVal in library with handle 0x00007f9a7c76e760
[0.845s][info][library] Found Java_sun_nio_ch_IOUtil_fdVal in library with handle 0x00007f9a7c0eccb0
[0.846s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_AFINET in library with handle 0x00007f9a7c7e4fd0
[0.846s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_AFINET in library with handle 0x00007f9a7c76e760
[0.847s][info][library] Found Java_sun_nio_ch_NativeSocketAddress_AFINET in library with handle 0x00007f9a7c0eccb0
[0.847s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_AFINET6 in library with handle 0x00007f9a7c7e4fd0
[0.848s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_AFINET6 in library with handle 0x00007f9a7c76e760
[0.848s][info][library] Found Java_sun_nio_ch_NativeSocketAddress_AFINET6 in library with handle 0x00007f9a7c0eccb0
[0.849s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_sizeofSockAddr4 in library with handle 0x00007f9a7c7e4fd0
[0.850s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_sizeofSockAddr4 in library with handle 0x00007f9a7c76e760
[0.850s][info][library] Found Java_sun_nio_ch_NativeSocketAddress_sizeofSockAddr4 in library with handle 0x00007f9a7c0eccb0
[0.855s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_sizeofSockAddr6 in library with handle 0x00007f9a7c7e4fd0
[0.859s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_sizeofSockAddr6 in library with handle 0x00007f9a7c76e760
[0.859s][info][library] Found Java_sun_nio_ch_NativeSocketAddress_sizeofSockAddr6 in library with handle 0x00007f9a7c0eccb0
[0.860s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_sizeofFamily in library with handle 0x00007f9a7c7e4fd0
[0.860s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_sizeofFamily in library with handle 0x00007f9a7c76e760
[0.861s][info][library] Found Java_sun_nio_ch_NativeSocketAddress_sizeofFamily in library with handle 0x00007f9a7c0eccb0
[0.861s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetFamily in library with handle 0x00007f9a7c7e4fd0
[0.862s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetFamily in library with handle 0x00007f9a7c76e760
[0.862s][info][library] Found Java_sun_nio_ch_NativeSocketAddress_offsetFamily in library with handle 0x00007f9a7c0eccb0
[0.863s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetSin4Port in library with handle 0x00007f9a7c7e4fd0
[0.863s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetSin4Port in library with handle 0x00007f9a7c76e760
[0.864s][info][library] Found Java_sun_nio_ch_NativeSocketAddress_offsetSin4Port in library with handle 0x00007f9a7c0eccb0
[0.864s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetSin4Addr in library with handle 0x00007f9a7c7e4fd0
[0.865s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetSin4Addr in library with handle 0x00007f9a7c76e760
[0.866s][info][library] Found Java_sun_nio_ch_NativeSocketAddress_offsetSin4Addr in library with handle 0x00007f9a7c0eccb0
[0.866s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetSin6Port in library with handle 0x00007f9a7c7e4fd0
[0.867s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetSin6Port in library with handle 0x00007f9a7c76e760
[0.870s][info][library] Found Java_sun_nio_ch_NativeSocketAddress_offsetSin6Port in library with handle 0x00007f9a7c0eccb0
[0.871s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetSin6Addr in library with handle 0x00007f9a7c7e4fd0
[0.871s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetSin6Addr in library with handle 0x00007f9a7c76e760
[0.872s][info][library] Found Java_sun_nio_ch_NativeSocketAddress_offsetSin6Addr in library with handle 0x00007f9a7c0eccb0
[0.872s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetSin6ScopeId in library with handle 0x00007f9a7c7e4fd0
[0.873s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetSin6ScopeId in library with handle 0x00007f9a7c76e760
[0.874s][info][library] Found Java_sun_nio_ch_NativeSocketAddress_offsetSin6ScopeId in library with handle 0x00007f9a7c0eccb0
[0.874s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetSin6FlowInfo in library with handle 0x00007f9a7c7e4fd0
[0.875s][info][library] Failed to find Java_sun_nio_ch_NativeSocketAddress_offsetSin6FlowInfo in library with handle 0x00007f9a7c76e760
[0.875s][info][library] Found Java_sun_nio_ch_NativeSocketAddress_offsetSin6FlowInfo in library with handle 0x00007f9a7c0eccb0
[0.877s][info][library] Failed to find Java_sun_nio_ch_Net_bind0 in library with handle 0x00007f9a7c7e4fd0
[0.880s][info][library] Failed to find Java_sun_nio_ch_Net_bind0 in library with handle 0x00007f9a7c76e760
[0.884s][info][library] Found Java_sun_nio_ch_Net_bind0 in library with handle 0x00007f9a7c0eccb0
[0.895s][info][library] Failed to find Java_sun_nio_ch_Net_localInetAddress in library with handle 0x00007f9a7c7e4fd0
[0.895s][info][library] Failed to find Java_sun_nio_ch_Net_localInetAddress in library with handle 0x00007f9a7c76e760
[0.896s][info][library] Found Java_sun_nio_ch_Net_localInetAddress in library with handle 0x00007f9a7c0eccb0
[0.896s][info][library] Failed to find Java_sun_nio_ch_Net_localPort in library with handle 0x00007f9a7c7e4fd0
[0.897s][info][library] Failed to find Java_sun_nio_ch_Net_localPort in library with handle 0x00007f9a7c76e760
[0.897s][info][library] Found Java_sun_nio_ch_Net_localPort in library with handle 0x00007f9a7c0eccb0
[0.898s][info][library] Failed to find Java_sun_nio_ch_Net_isReusePortAvailable0 in library with handle 0x00007f9a7c7e4fd0
[0.898s][info][library] Failed to find Java_sun_nio_ch_Net_isReusePortAvailable0 in library with handle 0x00007f9a7c76e760
[0.898s][info][library] Found Java_sun_nio_ch_Net_isReusePortAvailable0 in library with handle 0x00007f9a7c0eccb0
[0.900s][info][library] Failed to find Java_sun_nio_ch_Net_setIntOption0 in library with handle 0x00007f9a7c7e4fd0
[0.900s][info][library] Failed to find Java_sun_nio_ch_Net_setIntOption0 in library with handle 0x00007f9a7c76e760
[0.900s][info][library] Found Java_sun_nio_ch_Net_setIntOption0 in library with handle 0x00007f9a7c0eccb0
[0.914s][info][library] Failed to find Java_sun_nio_ch_IOUtil_configureBlocking in library with handle 0x00007f9a7c7e4fd0
[0.914s][info][library] Failed to find Java_sun_nio_ch_IOUtil_configureBlocking in library with handle 0x00007f9a7c76e760
[0.914s][info][library] Found Java_sun_nio_ch_IOUtil_configureBlocking in library with handle 0x00007f9a7c0eccb0
[0.915s][info][library] Failed to find Java_sun_nio_ch_Net_connect0 in library with handle 0x00007f9a7c7e4fd0
[0.915s][info][library] Failed to find Java_sun_nio_ch_Net_connect0 in library with handle 0x00007f9a7c76e760
[0.916s][info][library] Found Java_sun_nio_ch_Net_connect0 in library with handle 0x00007f9a7c0eccb0
[0.917s][info][library] Failed to find Java_sun_nio_ch_Net_pollConnect in library with handle 0x00007f9a7c7e4fd0
[0.920s][info][library] Failed to find Java_sun_nio_ch_Net_pollConnect in library with handle 0x00007f9a7c76e760
[0.920s][info][library] Found Java_sun_nio_ch_Net_pollConnect in library with handle 0x00007f9a7c0eccb0
[0.924s][info][library] Failed to find Java_sun_nio_ch_IOUtil_fdLimit in library with handle 0x00007f9a7c7e4fd0
[0.926s][info][library] Failed to find Java_sun_nio_ch_IOUtil_fdLimit in library with handle 0x00007f9a7c76e760
[0.926s][info][library] Found Java_sun_nio_ch_IOUtil_fdLimit in library with handle 0x00007f9a7c0eccb0
[0.927s][info][library] Failed to find Java_sun_nio_ch_EPoll_eventSize in library with handle 0x00007f9a7c7e4fd0
[0.928s][info][library] Failed to find Java_sun_nio_ch_EPoll_eventSize in library with handle 0x00007f9a7c76e760
[0.928s][info][library] Found Java_sun_nio_ch_EPoll_eventSize in library with handle 0x00007f9a7c0eccb0
[0.929s][info][library] Failed to find Java_sun_nio_ch_EPoll_eventsOffset in library with handle 0x00007f9a7c7e4fd0
[0.929s][info][library] Failed to find Java_sun_nio_ch_EPoll_eventsOffset in library with handle 0x00007f9a7c76e760
[0.929s][info][library] Found Java_sun_nio_ch_EPoll_eventsOffset in library with handle 0x00007f9a7c0eccb0
[0.930s][info][library] Failed to find Java_sun_nio_ch_EPoll_dataOffset in library with handle 0x00007f9a7c7e4fd0
[0.930s][info][library] Failed to find Java_sun_nio_ch_EPoll_dataOffset in library with handle 0x00007f9a7c76e760
[0.931s][info][library] Found Java_sun_nio_ch_EPoll_dataOffset in library with handle 0x00007f9a7c0eccb0
[0.931s][info][library] Failed to find Java_sun_nio_ch_EPoll_create in library with handle 0x00007f9a7c7e4fd0
[0.932s][info][library] Failed to find Java_sun_nio_ch_EPoll_create in library with handle 0x00007f9a7c76e760
[0.932s][info][library] Found Java_sun_nio_ch_EPoll_create in library with handle 0x00007f9a7c0eccb0
[0.933s][info][library] Failed to find Java_sun_nio_ch_EventFD_eventfd0 in library with handle 0x00007f9a7c7e4fd0
[0.933s][info][library] Failed to find Java_sun_nio_ch_EventFD_eventfd0 in library with handle 0x00007f9a7c76e760
[0.939s][info][library] Found Java_sun_nio_ch_EventFD_eventfd0 in library with handle 0x00007f9a7c0eccb0
[0.956s][info][library] Failed to find Java_sun_nio_ch_EPoll_ctl in library with handle 0x00007f9a7c7e4fd0
[0.966s][info][library] Failed to find Java_sun_nio_ch_EPoll_ctl in library with handle 0x00007f9a7c76e760
[0.971s][info][library] Found Java_sun_nio_ch_EPoll_ctl in library with handle 0x00007f9a7c0eccb0
[0.976s][info][library] Failed to find Java_sun_nio_ch_FileDispatcherImpl_write0 in library with handle 0x00007f9a7c7e4fd0
[0.977s][info][library] Failed to find Java_sun_nio_ch_FileDispatcherImpl_write0 in library with handle 0x00007f9a7c76e760
[0.977s][info][library] Found Java_sun_nio_ch_FileDispatcherImpl_write0 in library with handle 0x00007f9a7c0eccb0
[0.983s][info][library] Failed to find Java_sun_nio_ch_EPoll_wait in library with handle 0x00007f9a7c7e4fd0
[0.983s][info][library] Failed to find Java_sun_nio_ch_EPoll_wait in library with handle 0x00007f9a7c76e760
[0.984s][info][library] Found Java_sun_nio_ch_EPoll_wait in library with handle 0x00007f9a7c0eccb0
[0.988s][info][library] Failed to find Java_sun_nio_ch_SocketDispatcher_read0 in library with handle 0x00007f9a7c7e4fd0
[0.988s][info][library] Failed to find Java_sun_nio_ch_SocketDispatcher_read0 in library with handle 0x00007f9a7c76e760
[0.989s][info][library] Found Java_sun_nio_ch_SocketDispatcher_read0 in library with handle 0x00007f9a7c0eccb0

大部分输出都在谈论“找不到”库。但后来我看到它确实找到图书馆的其他行。

我应该使用其他一些参数来排除所有“找不到”的东西并只查看实际加载的内容吗?

明确一点,我只想查看由 Java 本地接口 (JNI) 调用的已加载本地库,因为我有证据表明 Java 应用程序在通过 JNI 调用某些本地代码时存在内存泄漏。

但是这个输出并没有像我希望的那样阐明这个问题。

也许我只是没读对?

java java-native-interface jvm-arguments java-17 native-code
2个回答
0
投票

如果我没记错的话,那些“带句柄”的东西不是库,而是库中预期的函数。

您主要对以“加载的库”开头的那些行感兴趣。


0
投票

正如其他人所提到的,“找到”和“未能找到”行是关于在库中查找的符号/函数。


统一日志记录(

-Xlog
)还允许您将输出通过管道传输到文件:

-Xlog:library=info:file=libraries_log.txt

然后在文件上使用

grep
(或Windows上的
sls
)来查找“加载的库”:

$ grep "Loaded library" ./libraries_log.txt
[0.021s][info][library] Loaded library libjsvml.so, handle 0x00007f9a7c0ca000
[0.045s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libnio.so, handle 0x00007f9a7c0eccb0
[0.053s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libzip.so, handle 0x00007f9a7c024da0
[0.213s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libjimage.so, handle 0x00007f9a7c002790
[0.532s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libnet.so, handle 0x00007f9a7c0ed2f0
[0.544s][info][library] Loaded library /root/.gradle/native/e1d6ef7f7dcc3fd88c89a11ec53ec762bb8ba0a96d01ffa2cd45eb1d1d8dd5c5/linux-amd64/libnative-platform.so, handle 0x00007f9a7c6cad60
[0.560s][info][library] Loaded library /root/.gradle/native/e1d6ef7f7dcc3fd88c89a11ec53ec762bb8ba0a96d01ffa2cd45eb1d1d8dd5c5/linux-amd64-ncurses6/libnative-platform-curses.so, handle 0x00007f9a7c6d0ef0
[0.667s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libmanagement.so, handle 0x00007f9a7c763730
[0.670s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libmanagement_ext.so, handle 0x00007f9a7c76e760
[0.807s][info][library] Loaded library /usr/lib/jvm/java-17-openjdk-amd64/lib/libextnet.so, handle 0x00007f9a7c7e4fd0

所有这些库都由 JVM 加载。请注意,JDK 还使用 JNI 本身来实现某些功能,因此这就是加载 JDK 目录中的一些库的原因。

我假设您感兴趣的图书馆是

/root/.gradle/native/*
图书馆?


然后您可以使用句柄的值,即行尾的十六进制值,来搜索正在该特定库中查找的符号。比如我取

/root/.gradle/native/*/linux-amd64/libnative-platform.so
的句柄值,就是
0x00007f9a7c6cad60
。我可以再次使用
grep
来查找 JVM 试图从该库加载哪些符号:

$ grep 0x00007f9a7c6cad60 ./libraries_log.txt
[0.544s][info][library] Loaded library /root/.gradle/native/e1d6ef7f7dcc3fd88c89a11ec53ec762bb8ba0a96d01ffa2cd45eb1d1d8dd5c5/linux-amd64/libnative-platform.so, handle
0x00007f9a7c6cad60
[0.545s][info][library] Found JNI_OnLoad in library with handle 0x00007f9a7c6cad60
[0.546s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_NativeLibraryFunctions_getVersion in library with handle 0x00007f9a7c6cad60
[0.565s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_PosixTerminalFunctions_isatty in library with handle 0x00007f9a7c6cad60
[0.703s][info][library] Found Java_net_rubygrapefruit_platform_internal_jni_PosixProcessFunctions_getPid in library with handle 0x00007f9a7c6cad60
© www.soinside.com 2019 - 2024. All rights reserved.