我们处理图像以从中提取各种功能。为此,我们提前调整图像大小。每当我们使用单个线程在离线过程中处理图像时,我们从未遇到过任何问题。但是当我们尝试处理多线程时,JVM崩溃不一致。
最大的问题是在同一组10K图像上,它会在崩溃之前处理整个集合几(2-3)次,而且我们使用-Xmx选项提供的内存越多,它就越有可能崩溃... (例如:12 GB在崩溃之前可能是30K图像,在16GB图像中它会在3-4张图像中崩溃)。 Server是30GB n 8 Core机器......
监控“top”显示虽然我们已经给出了-Xmx24g,但是当发生崩溃时内存使用量仅为20GB,所以我认为它与内存没有任何关系......
如果有人能给我一些关于问题可能是什么的见解,那么最感激。我认为它与线程有关,但我不知道是什么:(
消息:
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f61cd89e403, pid=31412, tid=140052355012352
#
# JRE version: Java(TM) SE Runtime Environment (7.0_67-b01) (build 1.7.0_67-b01)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.65-b04 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libawt.so+0x78403] IntRgbBicubicTransformHelper+0x143
============
--------------- T H R E A D ---------------
Current thread (0x00007f61640a3800): JavaThread "http-8090-81" daemon [_thread_in_native, id=31607, stack(0x00007f607aced000,0x00007f607adee000)]
siginfo:si_signo=SIGSEGV: si_errno=0, si_code=2 (SEGV_ACCERR), si_addr=0x0000000586d22158
Registers:
RAX=0xfffffffffffffff0, RBX=0x0000000000000000, RCX=0x0000000000000000, RDX=0x0000000586d22158
RSP=0x00007f607ade6ae8, RBP=0x00007f607ade6b10, RSI=0x0000000000000010, RDI=0x0000000000000010
R8 =0x0000000000000000, R9 =0x00000000080c3592, R10=0x0000000000000001, R11=0x0000000000000000
R12=0x0000000000000000, R13=0x0000000000000000, R14=0x00007f607ade8ce0, R15=0x080c3592b3333358
RIP=0x00007f61cd89e403, EFLAGS=0x0000000000010203, CSGSFS=0x000000000000e033, ERR=0x0000000000000004
TRAPNO=0x000000000000000e
Top of Stack: (sp=0x00007f607ade6ae8)
0x00007f607ade6ae8: 00007f61cdad0db8 0000000000000000
0x00007f607ade6af8: 00007f607adeae50 00007f61640a39e8
0x00007f607ade6b08: 00007f60100d6fb0 00007f607adeaee0
0x00007f607ade6b18: 00007f61cd86af78 0000000000000000
0x00007f607ade6b28: 00007f607adeace0 00007f607adead80
0x00007f607ade6b38: 00007f61cdad0db8 00007f607adeae90
0x00007f607ade6b48: 00007f607adeaca0 00007f607adead40
0x00007f607ade6b58: 00007f607ade7130 00007f607ade8ce0
0x00007f607ade6b68: 00007f607adeae90 ffffff807adeae40
0x00007f607ade6b78: 00007f607adeaf38 00007f6000000000
0x00007f607ade6b88: 00007f607adeace0 00007f607adead80
0x00007f607ade6b98: 00007f607adeae20 00007f607adeaea8
0x00007f607ade6ba8: 00007f607adeaea0 00007f607adeae80
0x00007f607ade6bb8: 00007f607adeaf78 00000001c6666666
0x00007f607ade6bc8: 00007f60100d29a0 0000008000000000
0x00007f607ade6bd8: 00007f61cd89e2c0 00007f61cd869900
0x00007f607ade6be8: 419999999999999a 432997b8af8af8b0
0x00007f607ade6bf8: 00007f607ade6cd0 000000000ccccccc
0x00007f607ade6c08: 0000000000000000 0000000000000000
0x00007f607ade6c18: 001997b8af8af8b0 0000000006666666
0x00007f607ade6c28: 000ccbdc57c57c58 0000000006666666
0x00007f607ade6c38: 080c359333333358 0000000006666666
0x00007f607ade6c48: 080c359333333358 00000050f9999991
0x00007f607ade6c58: 000000461cccccbd 0000002800000000
0x00007f607ade6c68: 0000002800000028 ffffff8000000000
0x00007f607ade6c78: 00000000e3333333 0000004d0666665e
0x00007f607ade6c88: 0000005000000080 0e0bc4dc57c57c98
0x00007f607ade6c98: 00000003f999995a 0000008c00000000
0x00007f607ade6ca8: 0000005000000050 0000002800000000
0x00007f607ade6cb8: 0000000006666666 0df22d23a83a83e8
0x00007f607ade6cc8: 0000002800000000 0000008c00000000
0x00007f607ade6cd8: 0000005000000000 0000005000000000
Instructions: (pc=0x00007f61cd89e403)
0x00007f61cd89e3e3: f6 44 23 65 c0 0f af 55 a4 44 01 e7 48 63 ff 48
0x00007f61cd89e3f3: 63 d2 48 03 53 10 43 8d 1c 03 48 63 db 48 01 c2
0x00007f61cd89e403: 8b 04 8a 0d 00 00 00 ff 41 89 06 42 8b 04 aa 0d
0x00007f61cd89e413: 00 00 00 ff 41 89 46 04 8b 04 9a 0d 00 00 00 ff
Register to memory mapping:
RAX=0xfffffffffffffff0 is an unknown value
RBX=0x0000000000000000 is an unknown value
RCX=0x0000000000000000 is an unknown value
RDX=0x0000000586d22158 is an unallocated location in the heap
RSP=0x00007f607ade6ae8 is pointing into the stack for thread: 0x00007f61640a3800
RBP=0x00007f607ade6b10 is pointing into the stack for thread: 0x00007f61640a3800
RSI=0x0000000000000010 is an unknown value
RDI=0x0000000000000010 is an unknown value
R8 =0x0000000000000000 is an unknown value
R9 =0x00000000080c3592 is an unknown value
R10=0x0000000000000001 is an unknown value
R11=0x0000000000000000 is an unknown value
R12=0x0000000000000000 is an unknown value
R13=0x0000000000000000 is an unknown value
R14=0x00007f607ade8ce0 is pointing into the stack for thread: 0x00007f61640a3800
R15=0x080c3592b3333358 is an unknown value
Stack: [0x00007f607aced000,0x00007f607adee000], sp=0x00007f607ade6ae8, free space=998k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libawt.so+0x78403] IntRgbBicubicTransformHelper+0x143
C [libawt.so+0x44f78] Java_sun_java2d_loops_TransformHelper_Transform+0xe08
J 2084 sun.java2d.loops.TransformHelper.Transform(Lsun/java2d/loops/MaskBlit;Lsun/java2d/SurfaceData;Lsun/java2d/SurfaceData;Ljava/awt/Composite;Lsun/java2d/pipe/Region;Ljava/awt/geom/AffineTransform;IIIIIIIII[III)V (0 bytes) @ 0x00007f6241682ab3 [0x00007f62416828e0+0x1d3]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 2084 sun.java2d.loops.TransformHelper.Transform(Lsun/java2d/loops/MaskBlit;Lsun/java2d/SurfaceData;Lsun/java2d/SurfaceData;Ljava/awt/Composite;Lsun/java2d/pipe/Region;Ljava/awt/geom/AffineTransform;IIIIIIIII[III)V (0 bytes) @ 0x00007f6241682a39 [0x00007f62416828e0+0x159]
J 1526 C2 sun.java2d.pipe.DrawImage.renderImageXform(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;Ljava/awt/geom/AffineTransform;IIIIILjava/awt/Color;)V (773 bytes) @ 0x00007f624150bdd4 [0x00007f624150b560+0x874]
J 2059 C2 sun.java2d.pipe.ValidatePipe.scaleImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IIIILjava/awt/Color;Ljava/awt/image/ImageObserver;)Z (33 bytes) @ 0x00007f624168651c [0x00007f6241685ea0+0x67c]
J 2071 C2 *****************Image.resize(II)V (71 bytes) @ 0x00007f62416963e8 [0x00007f62416961c0+0x228]
..............