使用sigar项目启动报错

项目运行时使用sigar库监控CPU,遇到异常访问错误。尝试将sigar相关dll文件放入jdk/bin目录未解决问题。进一步调查发现是高版本的JDK(如1.8_251+)与sigar-amd64-winnt.dll不兼容。降低JDK版本到1.8_241后,问题得到解决。
摘要由CSDN通过智能技术生成

项目中使用了sigar来监测cpu的使用情况,在项目启动时,报错如下

PS C:\Users\sebin.vincent> e:
PS E:\> .\Softwares\ServerAgent-2.2.3\startAgent.bat
INFO    2019-12-30 12:17:45.122 [kg.apc.p] (): Binding UDP to 4444
INFO    2019-12-30 12:17:45.155 [kg.apc.p] (): Binding TCP to 4444
INFO    2019-12-30 12:17:45.157 [kg.apc.p] (): JP@GC Agent v2.2.3 started
INFO    2019-12-30 12:18:59.180 [kg.apc.p] (): Accepting new TCP connection
INFO    2019-12-30 12:18:59.184 [kg.apc.p] (): Yep, we received the 'test' command
INFO    2019-12-30 12:18:59.187 [kg.apc.p] (): Starting measures: memory:       cpu:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000010014ed4, pid=19028, tid=3160
#
# JRE version: Java(TM) SE Runtime Environment (11.0.4+10) (build 11.0.4+10-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.4+10-LTS, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C  [sigar-amd64-winnt.dll+0x14ed4]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# E:\\hs_err_pid19028.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

去具体报错文件查看并百度后,很多回答为:
sigar-amd64-winnt.dll
sigar-x86-winnt.dll
sigar-x86-winnt.lib
将三个文件放入 jdk/bin目录下,但是尝试后依然报错。
dll文件获取地址:https://gitee.com/wanghouhou/wgcloud/raw/master/sigarLibs.zip

后续再次排查发现为jdk版本问题较高版本的jdk如1.8_251+和sigar-amd64-winnt.dll不匹配,将jdk版本降低至1.8_241后启动成功。

参考:

jdk历史版本下载链接:https://www.oracle.com/java/technologies/oracle-java-archive-downloads.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值