一次难忘的JVM内存调试经历(CUDA+Opencv+JNI+Storm)

在构建基于GPU/FPGA加速和Storm的实时视频处理平台时,将CUDA+OpenCV的前景提取算法整合过程中遇到内存问题。错误发生在Mat对象在 finalize 时尝试删除指针。通过分析worker.log,发现可能是局部变量Mat在GC回收时出错。通过调用System.gc()触发问题,并定位到变量out的回收影响了C++中的result_mask内存区域。修改JNI代码后问题解决,但原因分析仍在进行。
摘要由CSDN通过智能技术生成

最近在做一个基于硬件(GPU / FPGA)加速和storm的实时视频处理平台,前两天准备把之前做过的一个基于cuda+opencv的前景提取算法并入平台中,出现一些小问题,坎坷的两天调试历程,特此记录下来。。。

这里先列出storm运行时的worker.log内容

2016-08-25 12:15:12.498 STDERR [INFO] *** glibc detected *** java: free(): invalid next size (fast): 0x00007f88b426dac0 ***
2016-08-25 12:15:12.498 STDERR [INFO] #
2016-08-25 12:15:12.499 STDERR [INFO] # A fatal error has been detected by the Java Runtime Environment:
2016-08-25 12:15:12.499 STDERR [INFO] #
2016-08-25 12:15:12.499 STDERR [INFO] #  SIGSEGV (0xb) at pc=0x00007f89cc0e8d82, pid=262213, tid=140227882673920
2016-08-25 12:15:12.499 STDERR [INFO] #
2016-08-25 12:15:12.500 STDERR [INFO] # JRE version: OpenJDK Runtime Environment (7.0_101) (build 1.7.0_101-mockbuild_2016_05_12_04_54-b00)
2016-08-25 12:15:12.500 STDERR [INFO] # Java VM: OpenJDK 64-Bit Server VM (24.95-b01 mixed mode linux-amd64 compressed oops)
2016-08-25 12:15:12.500 STDERR [INFO] # Derivative: IcedTea 2.6.6pre01
2016-08-25 12:15:12.500 STDERR [INFO] # Distribution: CentOS release 6.7 (Final), package rhel-2.6.6.4.el6_8-x86_64 u101-b00
2016-08-25 12:15:12.500 STDERR [INFO] # Problematic frame:
2016-08-25 12:15:12.501 STDERR [INFO] # C  [ld-linux-x86-64.so.2+0x12d82]  dl_open_worker+0x242
2016-08-25 12:15:12.501 STDERR [INFO] #
2016-08-25 12:15:12.501 STDERR [INFO] # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
2016-08-25 12:15:12.501 STDERR [INFO] #
2016-08-25 12:15:12.501 STDERR [INFO] # An error report file with more information is saved as:
2016-08-25 12:15:12.501 STDERR [INFO] # <span style="color:#ff0000;">/tmp/jvm-262213/hs_error.log</span>
2016-08-25 12:15:12.508 STDERR [INFO] #
2016-08-25 12:15:12.509 STDERR [INFO] # If you would like to submit a bug report, please include
2016-08-25 12:15:12.509 STDERR [INFO] # instructions on how to reproduce the bug and visit:
20
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值