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

of1yzvn4  于 2023-02-28  发布在  Java
关注(0)|答案(2)|浏览(164)

我使用JVM选项-Xlog:library=trace-based on advice in another question启动了我的应用程序,以查看正在加载哪些原生库。
但输出结果相当混乱--见下图:

[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 Native Interface(JNI)调用的已加载本机库,因为我有证据表明,当Java应用程序通过JNI调用某些本机代码时,它会发生内存泄漏。
但这一结果并没有像我希望的那样阐明这一问题。
或者我没阅读对?

7kjnsjlb

7kjnsjlb1#

正如其他人所提到的,“找到”和“找不到”行是关于在库中查找符号/函数的。
统一日志记录(-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
soat7uwm

soat7uwm2#

如果我没记错的话,那些“带句柄”的东西不是库,而是库中的函数。
您感兴趣的主要是那些以“已加载库”开头的行。

相关问题