Problem with parallel inference

Hi,

I’m trying to implement ParallelInference.
But i got a crash from my JVM.

My model :

I start some thread and I replace implementation :

by :

ParallelInference model = pil;
if (isChiffre) {
    model = pic;
}

with :

pic = new ParallelInference.Builder(chiffreModel).build();

Some idea about this bug ? How can I tune my JVM correctly ?

Cheers.

Can you share the error report file (C:\project\hs_err_pid5256.log)? It should contain some more information

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffc14496a72, pid=5256, tid=9996
#
# JRE version: Java(TM) SE Runtime Environment (11.0.6+8) (build 11.0.6+8-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.6+8-LTS, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C  0x00007ffc14496a72
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# 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.
#

---------------  S U M M A R Y ------------

Command Line: -Djava.library.path=C:\prgm\opencv\build\java\x64 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=52870 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dspring.jmx.enabled=true -Dspring.application.admin.enabled=true -Xms512m -Xmx512m -Dorg.bytedeco.javacpp.maxbytes=8G -Dorg.bytedeco.javacpp.maxphysicalbytes=8G -Dexpl.mod=audit -Xverify:none -XX:TieredStopAtLevel=1 -Dspring.boot.project.name=ws_santorin_images -Dfile.encoding=UTF-8 fr.project.audit.RapportNumerisation --spring.profiles.active=dev,audit,local

Host: Intel(R) Xeon(R) CPU E3-1240 v5 @ 3.50GHz, 8 cores, 15G,  Windows 10 , 64 bit Build 18362 (10.0.18362.329)
Time: Thu May  7 14:11:33 2020 Paris, Madrid (heure d?été) elapsed time: 102 seconds (0d 0h 1m 42s)

---------------  T H R E A D  ---------------

Current thread (0x000002d3862ec800):  JavaThread "SimpleAsyncTaskExecutor-2725" [_thread_in_native, id=9996, stack(0x000000eb62500000,0x000000eb62600000)]

Stack: [0x000000eb62500000,0x000000eb62600000],  sp=0x000000eb625fc0a0,  free space=1008k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  0x00007ffc14496a72

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 11837  org.bytedeco.opencv.global.opencv_imgproc.resize(Lorg/bytedeco/opencv/opencv_core/Mat;Lorg/bytedeco/opencv/opencv_core/Mat;Lorg/bytedeco/opencv/opencv_core/Size;)V (0 bytes) @ 0x000002d3ef91763f [0x000002d3ef9175c0+0x000000000000007f]
J 11849 c1 org.datavec.image.loader.NativeImageLoader.scalingIfNeed(Lorg/bytedeco/opencv/opencv_core/Mat;JJ)Lorg/bytedeco/opencv/opencv_core/Mat; (78 bytes) @ 0x000002d3ef91c97c [0x000002d3ef91c720+0x000000000000025c]
J 11848 c1 org.datavec.image.loader.NativeImageLoader.transformImage(Lorg/bytedeco/opencv/opencv_core/Mat;Lorg/nd4j/linalg/api/ndarray/INDArray;)Lorg/nd4j/linalg/api/ndarray/INDArray; (455 bytes) @ 0x000002d3ef91b3fc [0x000002d3ef91b000+0x00000000000003fc]
J 11813 c1 org.datavec.image.loader.NativeImageLoader.asMatrix(Lorg/opencv/core/Mat;)Lorg/nd4j/linalg/api/ndarray/INDArray; (40 bytes) @ 0x000002d3ef90a1cc [0x000002d3ef90a140+0x000000000000008c]
J 11798 c1 fr.project.service.ocr.copie.ReconnaissanceCaractere.neuralReader(Lorg/opencv/core/Mat;ZLjava/util/List;)Ljava/lang/String; (302 bytes) @ 0x000002d3ef902694 [0x000002d3ef902260+0x0000000000000434]
J 12182 c1 fr.project.service.ocr.copie.ReconnaissanceCopie.ocrElementImg(Lorg/opencv/core/Mat;Lfr/project/service/ocr/copie/bean/element/DetectElement;Lfr/project/service/ocr/copie/bean/ElementValues;)Ljava/lang/String; (229 bytes) @ 0x000002d3ef9c2dc4 [0x000002d3ef9c2920+0x00000000000004a4]
J 12209 c1 fr.project.service.ocr.copie.ReconnaissanceCopie.asyncOCRElementOfPage(Lfr/project/service/ocr/copie/bean/element/DetectElement;Lorg/opencv/core/Mat;Lfr/project/service/ocr/copie/bean/ElementValues;)Ljava/util/concurrent/CompletableFuture; (114 bytes) @ 0x000002d3ef9cfa24 [0x000002d3ef9cf960+0x00000000000000c4]
J 12001 c1 fr.project.service.ocr.copie.ReconnaissanceCopie$$FastClassBySpringCGLIB$$f44b523c.invoke(ILjava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (515 bytes) @ 0x000002d3ef964664 [0x000002d3ef963d40+0x0000000000000924]
J 11791 c1 org.springframework.cglib.proxy.MethodProxy.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (72 bytes) @ 0x000002d3ef8fd98c [0x000002d3ef8fd900+0x000000000000008c]
J 12000 c1 org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint()Ljava/lang/Object; (28 bytes) @ 0x000002d3ef96362c [0x000002d3ef9635e0+0x000000000000004c]
J 10624 c1 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()Ljava/lang/Object; (126 bytes) @ 0x000002d3ef6a7a5c [0x000002d3ef6a7840+0x000000000000021c]
J 11492 c1 org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed()Ljava/lang/Object; (34 bytes) @ 0x000002d3ef86599c [0x000002d3ef865960+0x000000000000003c]
J 12208 c1 org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(Lorg/aopalliance/intercept/MethodInvocation;Ljava/lang/reflect/Method;)Ljava/lang/Object; (61 bytes) @ 0x000002d3ef9cf174 [0x000002d3ef9cf120+0x0000000000000054]
J 12207 c1 org.springframework.aop.interceptor.AsyncExecutionInterceptor$$Lambda$1774.call()Ljava/lang/Object; (16 bytes) @ 0x000002d3ef9ced04 [0x000002d3ef9cecc0+0x0000000000000044]
J 12205 c1 org.springframework.aop.interceptor.AsyncExecutionAspectSupport$$Lambda$1775.get()Ljava/lang/Object; (8 bytes) @ 0x000002d3ef9ce424 [0x000002d3ef9ce3e0+0x0000000000000044]
J 12145 c1 java.util.concurrent.CompletableFuture$AsyncSupply.run()V java.base@11.0.6 (61 bytes) @ 0x000002d3ef9b2abc [0x000002d3ef9b2a20+0x000000000000009c]
J 8758 c1 java.lang.Thread.run()V java.base@11.0.6 (17 bytes) @ 0x000002d3ef41570c [0x000002d3ef4156c0+0x000000000000004c]
v  ~StubRoutines::call_stub

siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x000002d400ecd058

Register to memory mapping:

RIP=0x00007ffc14496a72 points into unknown readable memory: 44 0f b6 1c 29 42
RAX=0xfffffffffffff5d0 is an unknown value
RBX=0x000000eb625fcc94 is pointing into the stack for thread: 0x000002d3862ec800
RCX=0x0 is NULL
RDX=0x000000000000001c is an unknown value
RSP=0x000000eb625fc0a0 is pointing into the stack for thread: 0x000002d3862ec800
RBP=0x000002d400ecd058 is an unknown value
RSI=0x000002d400ecc784 points into unknown readable memory: 00 00 00 00
RDI=0xfffffffffffff5d0 is an unknown value
R8 =0x000000eb625fc640 is pointing into the stack for thread: 0x000002d3862ec800
R9 =0x000000000000046e is an unknown value
R10=0x0000000000000392 is an unknown value
R11=0x000000eb625fcd70 is pointing into the stack for thread: 0x000002d3862ec800
R12=0x0000000000000001 is an unknown value
R13=0x00000000000000e0 is an unknown value
R14=0xfffffffffffff550 is an unknown value
R15=0x000000000000001c is an unknown value


Registers:
RAX=0xfffffffffffff5d0, RBX=0x000000eb625fcc94, RCX=0x0000000000000000, RDX=0x000000000000001c
RSP=0x000000eb625fc0a0, RBP=0x000002d400ecd058, RSI=0x000002d400ecc784, RDI=0xfffffffffffff5d0
R8 =0x000000eb625fc640, R9 =0x000000000000046e, R10=0x0000000000000392, R11=0x000000eb625fcd70
R12=0x0000000000000001, R13=0x00000000000000e0, R14=0xfffffffffffff550, R15=0x000000000000001c
RIP=0x00007ffc14496a72, EFLAGS=0x0000000000010283

Top of Stack: (sp=0x000000eb625fc0a0)
0x000000eb625fc0a0:   000000eb625fc648 0000000000000001
0x000000eb625fc0b0:   fffffffffffff550 000000eb625fc848
0x000000eb625fc0c0:   000000eb625fc260 0000000000000000
0x000000eb625fc0d0:   000000eb625fc1e0 0000000000000080
0x000000eb625fc0e0:   0000000000000001 0000000000000000
0x000000eb625fc0f0:   0000000000000000 0000000000000002
0x000000eb625fc100:   000000eb625fc860 0000000000000020
0x000000eb625fc110:   000000000000004b 000000000000004c
0x000000eb625fc120:   000000eb625fc230 00007ffc144a4d88
0x000000eb625fc130:   0000000000000002 000000eb625fc6c0
0x000000eb625fc140:   000000eb625fc640 0000000000000002
0x000000eb625fc150:   000000eb625fcc90 000000eb625fcd70
0x000000eb625fc160:   0000000000000035 000000000000001c
0x000000eb625fc170:   0000000000000001 00007ffc00000000
0x000000eb625fc180:   000000000000001c 0000000000000000
0x000000eb625fc190:   0000001a00000000 0000004b00000001 

Instructions: (pc=0x00007ffc14496a72)
0x00007ffc14496a52:   2b ef 49 8b df 49 2b c7 4c 8b fa 48 8b f8 48 63
0x00007ffc14496a62:   0b 46 0f bf 0c 2b 46 0f bf 54 2b 02 48 8d 5b 04
0x00007ffc14496a72:   44 0f b6 1c 29 42 8d 04 21 0f b6 0c 31 4c 63 c0
0x00007ffc14496a82:   45 0f af d9 41 0f af c9 41 0f b6 04 28 41 0f af 


Stack slot to memory mapping:
stack at sp + 0 slots: 0x000000eb625fc648 is pointing into the stack for thread: 0x000002d3862ec800
stack at sp + 1 slots: 0x0000000000000001 is an unknown value
stack at sp + 2 slots: 0xfffffffffffff550 is an unknown value
stack at sp + 3 slots: 0x000000eb625fc848 is pointing into the stack for thread: 0x000002d3862ec800
stack at sp + 4 slots: 0x000000eb625fc260 is pointing into the stack for thread: 0x000002d3862ec800
stack at sp + 5 slots: 0x0 is NULL
stack at sp + 6 slots: 0x000000eb625fc1e0 is pointing into the stack for thread: 0x000002d3862ec800
stack at sp + 7 slots: 0x0000000000000080 is an unknown value

---------------  P R O C E S S  ---------------

Threads class SMR info:
_java_thread_list=0x000002d3c7538db0, length=86, elements={
0x000002d3e5a20800, 0x000002d3ff714000, 0x000002d3ff73f800, 0x000002d3ff792800,
0x000002d3ff793000, 0x000002d3ff79e000, 0x000002d3ff7a4800, 0x000002d3ff951000,
0x000002d3ff9e2800, 0x000002d382eea800, 0x000002d382ebe000, 0x000002d382f56000,
0x000002d383366800, 0x000002d383367800, 0x000002d383374800, 0x000002d3833c0000,
0x000002d3833c1800, 0x000002d385d7d000, 0x000002d385d7a800, 0x000002d385d7b000,
0x000002d385d7c000, 0x000002d38729f000, 0x000002d3872a2800, 0x000002d3872a3000,
0x000002d3872a4000, 0x000002d38729e800, 0x000002d3872a0800, 0x000002d3872a1800,
0x000002d3872a5000, 0x000002d3872a5800, 0x000002d3872a0000, 0x000002d3872ac000,
0x000002d3872a9800, 0x000002d3872aa800, 0x000002d3872a6800, 0x000002d3872a7800,
0x000002d3872ab800, 0x000002d3872ad000, 0x000002d3872a8000, 0x000002d3872a9000,
0x000002d387757000, 0x000002d387756800, 0x000002d387758000, 0x000002d387759000,
0x000002d387755000, 0x000002d387759800, 0x000002d38775a800, 0x000002d38775b800,
0x000002d387755800, 0x000002d387761000, 0x000002d38775c000, 0x000002d3877e4000,
0x000002d3877e5800, 0x000002d3877e1800, 0x000002d3877e2000, 0x000002d3877e0800,
0x000002d3877e3000, 0x000002d3862e5000, 0x000002d3862e5800, 0x000002d3862e6800,
0x000002d3862e3800, 0x000002d3862e8000, 0x000002d3862e9000, 0x000002d3862e7800,
0x000002d3862ea000, 0x000002d3862e4000, 0x000002d3862ee800, 0x000002d3862ef800,
0x000002d3895c5000, 0x000002d3895c0800, 0x000002d3895c7800, 0x000002d3895c2000,
0x000002d3895c6000, 0x000002d3895c8800, 0x000002d387763800, 0x000002d38775e000,
0x000002d38775f800, 0x000002d3895c2800, 0x000002d3895c3800, 0x000002d3895c9800,
0x000002d3895cb000, 0x000002d3895cb800, 0x000002d3894d0000, 0x000002d3894d2800,
0x000002d3894d1000, 0x000002d3862ec800
}

Java Threads: ( => current thread )
  0x000002d3e5a20800 JavaThread "main" [_thread_blocked, id=12692, stack(0x000000eb57c00000,0x000000eb57d00000)]
  0x000002d3ff714000 JavaThread "Reference Handler" daemon [_thread_blocked, id=13372, stack(0x000000eb58300000,0x000000eb58400000)]
  0x000002d3ff73f800 JavaThread "Finalizer" daemon [_thread_blocked, id=11316, stack(0x000000eb58400000,0x000000eb58500000)]
  0x000002d3ff792800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=264, stack(0x000000eb58500000,0x000000eb58600000)]
  0x000002d3ff793000 JavaThread "Attach Listener" daemon [_thread_blocked, id=14136, stack(0x000000eb58600000,0x000000eb58700000)]
  0x000002d3ff79e000 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=3360, stack(0x000000eb58700000,0x000000eb58800000)]
  0x000002d3ff7a4800 JavaThread "Sweeper thread" daemon [_thread_blocked, id=3664, stack(0x000000eb58800000,0x000000eb58900000)]
  0x000002d3ff951000 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=7048, stack(0x000000eb58900000,0x000000eb58a00000)]
  0x000002d3ff9e2800 JavaThread "Service Thread" daemon [_thread_blocked, id=7892, stack(0x000000eb58a00000,0x000000eb58b00000)]
  0x000002d382eea800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2464, stack(0x000000eb59200000,0x000000eb59300000)]
  0x000002d382ebe000 JavaThread "RMI TCP Accept-52870" daemon [_thread_in_native, id=5744, stack(0x000000eb59300000,0x000000eb59400000)]
  0x000002d382f56000 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=420, stack(0x000000eb59400000,0x000000eb59500000)]
  0x000002d383366800 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=11144, stack(0x000000eb59700000,0x000000eb59800000)]
  0x000002d383367800 JavaThread "RMI TCP Connection(2)-127.0.0.1" daemon [_thread_in_native, id=5720, stack(0x000000eb59800000,0x000000eb59900000)]
  0x000002d383374800 JavaThread "JMX server connection timeout 20" daemon [_thread_blocked, id=3136, stack(0x000000eb59900000,0x000000eb59a00000)]
  0x000002d3833c0000 JavaThread "Thread-0" [_thread_blocked, id=5264, stack(0x000000eb59a00000,0x000000eb59b00000)]
  0x000002d3833c1800 JavaThread "restartedMain" [_thread_blocked, id=10276, stack(0x000000eb59b00000,0x000000eb59c00000)]
  0x000002d385d7d000 JavaThread "RMI TCP Connection(3)-127.0.0.1" daemon [_thread_in_native, id=11492, stack(0x000000eb59c00000,0x000000eb59d00000)]
  0x000002d385d7a800 JavaThread "JMX server connection timeout 26" daemon [_thread_blocked, id=10700, stack(0x000000eb59e00000,0x000000eb59f00000)]
  0x000002d385d7b000 JavaThread "lettuce-eventExecutorLoop-1-1" daemon [_thread_blocked, id=12808, stack(0x000000eb59f00000,0x000000eb5a000000)]
  0x000002d385d7c000 JavaThread "cluster-ClusterId{value='5eb3fa95fa0f797264207cb6', description='null'}-localhost:27017" daemon [_thread_blocked, id=2496, stack(0x000000eb5a000000,0x000000eb5a100000)]
  0x000002d38729f000 JavaThread "cluster-ClusterId{value='5eb3fa96fa0f797264207cb7', description='null'}-localhost:27017" daemon [_thread_blocked, id=9040, stack(0x000000eb5a200000,0x000000eb5a300000)]
  0x000002d3872a2800 JavaThread "Catalina-utility-1" [_thread_blocked, id=3276, stack(0x000000eb5a300000,0x000000eb5a400000)]
  0x000002d3872a3000 JavaThread "Catalina-utility-2" [_thread_blocked, id=9344, stack(0x000000eb5a400000,0x000000eb5a500000)]
  0x000002d3872a4000 JavaThread "container-0" [_thread_blocked, id=11064, stack(0x000000eb5a500000,0x000000eb5a600000)]
  0x000002d38729e800 JavaThread "JavaCPP Deallocator" daemon [_thread_blocked, id=9596, stack(0x000000eb5ad00000,0x000000eb5ae00000)]
  0x000002d3872a0800 JavaThread "InferenceThread-0" daemon [_thread_in_native, id=13096, stack(0x000000eb5bd00000,0x000000eb5be00000)]
  0x000002d3872a1800 JavaThread "InferenceThread-0" daemon [_thread_blocked, id=6240, stack(0x000000eb5be00000,0x000000eb5bf00000)]
  0x000002d3872a5000 JavaThread "File Watcher" daemon [_thread_blocked, id=13740, stack(0x000000eb5bf00000,0x000000eb5c000000)]
  0x000002d3872a5800 JavaThread "scheduling-1" [_thread_blocked, id=7680, stack(0x000000eb5c000000,0x000000eb5c100000)]
  0x000002d3872a0000 JavaThread "http-nio-8085-BlockPoller" daemon [_thread_in_native, id=7896, stack(0x000000eb5c100000,0x000000eb5c200000)]
  0x000002d3872ac000 JavaThread "http-nio-8085-exec-1" daemon [_thread_blocked, id=14172, stack(0x000000eb5c200000,0x000000eb5c300000)]
  0x000002d3872a9800 JavaThread "http-nio-8085-exec-2" daemon [_thread_blocked, id=13012, stack(0x000000eb5c300000,0x000000eb5c400000)]
  0x000002d3872aa800 JavaThread "http-nio-8085-exec-3" daemon [_thread_blocked, id=6200, stack(0x000000eb5c400000,0x000000eb5c500000)]
  0x000002d3872a6800 JavaThread "http-nio-8085-exec-4" daemon [_thread_blocked, id=15340, stack(0x000000eb5c500000,0x000000eb5c600000)]
  0x000002d3872a7800 JavaThread "http-nio-8085-exec-5" daemon [_thread_blocked, id=14608, stack(0x000000eb5c600000,0x000000eb5c700000)]
  0x000002d3872ab800 JavaThread "http-nio-8085-exec-6" daemon [_thread_blocked, id=9000, stack(0x000000eb5c700000,0x000000eb5c800000)]
  0x000002d3872ad000 JavaThread "http-nio-8085-exec-7" daemon [_thread_blocked, id=8180, stack(0x000000eb5c800000,0x000000eb5c900000)]
  0x000002d3872a8000 JavaThread "http-nio-8085-exec-8" daemon [_thread_blocked, id=14188, stack(0x000000eb5c900000,0x000000eb5ca00000)]
  0x000002d3872a9000 JavaThread "http-nio-8085-exec-9" daemon [_thread_blocked, id=9552, stack(0x000000eb5ca00000,0x000000eb5cb00000)]
  0x000002d387757000 JavaThread "http-nio-8085-exec-10" daemon [_thread_blocked, id=15080, stack(0x000000eb5cb00000,0x000000eb5cc00000)]
  0x000002d387756800 JavaThread "http-nio-8085-ClientPoller" daemon [_thread_in_native, id=5420, stack(0x000000eb5cc00000,0x000000eb5cd00000)]
  0x000002d387758000 JavaThread "http-nio-8085-Acceptor" daemon [_thread_in_native, id=13576, stack(0x000000eb5d400000,0x000000eb5d500000)]
  0x000002d387759000 JavaThread "pool-2-thread-1" [_thread_in_native, id=12100, stack(0x000000eb5d500000,0x000000eb5d600000)]
  0x000002d387755000 JavaThread "pool-2-thread-2" [_thread_blocked, id=10232, stack(0x000000eb5d600000,0x000000eb5d700000)]
  0x000002d387759800 JavaThread "pool-2-thread-3" [_thread_blocked, id=11928, stack(0x000000eb5d700000,0x000000eb5d800000)]
  0x000002d38775a800 JavaThread "pool-2-thread-4" [_thread_in_native, id=12848, stack(0x000000eb5d800000,0x000000eb5d900000)]
  0x000002d38775b800 JavaThread "pool-2-thread-5" [_thread_in_native, id=15040, stack(0x000000eb5d900000,0x000000eb5da00000)]
  0x000002d387755800 JavaThread "pool-2-thread-6" [_thread_in_native, id=8648, stack(0x000000eb5da00000,0x000000eb5db00000)]
  0x000002d387761000 JavaThread "pool-2-thread-7" [_thread_in_native, id=15328, stack(0x000000eb5db00000,0x000000eb5dc00000)]
  0x000002d38775c000 JavaThread "pool-2-thread-8" [_thread_in_native, id=6372, stack(0x000000eb5dc00000,0x000000eb5dd00000)]
  0x000002d3877e4000 JavaThread "DeallocatorServiceThread_0" daemon [_thread_blocked, id=9756, stack(0x000000eb60900000,0x000000eb60a00000)]
  0x000002d3877e5800 JavaThread "DeallocatorServiceThread_1" daemon [_thread_blocked, id=9988, stack(0x000000eb60a00000,0x000000eb60b00000)]
  0x000002d3877e1800 JavaThread "ocr-2" [_thread_blocked, id=15232, stack(0x000000eb5e500000,0x000000eb5e600000)]
  0x000002d3877e2000 JavaThread "ocr-1" [_thread_blocked, id=12088, stack(0x000000eb5e600000,0x000000eb5e700000)]
  0x000002d3877e0800 JavaThread "ocr-3" [_thread_blocked, id=7156, stack(0x000000eb5e700000,0x000000eb5e800000)]
  0x000002d3877e3000 JavaThread "ocr-4" [_thread_blocked, id=12284, stack(0x000000eb5e800000,0x000000eb5e900000)]
  0x000002d3862e5000 JavaThread "ocr-5" [_thread_blocked, id=3644, stack(0x000000eb5e900000,0x000000eb5ea00000)]
  0x000002d3862e5800 JavaThread "ocr-6" [_thread_blocked, id=12608, stack(0x000000eb5ea00000,0x000000eb5eb00000)]
  0x000002d3862e6800 JavaThread "ocr-7" [_thread_blocked, id=12268, stack(0x000000eb5eb00000,0x000000eb5ec00000)]
  0x000002d3862e3800 JavaThread "ocr-8" [_thread_blocked, id=9224, stack(0x000000eb5ec00000,0x000000eb5ed00000)]
  0x000002d3862e8000 JavaThread "ocr-9" [_thread_blocked, id=15248, stack(0x000000eb5ef00000,0x000000eb5f000000)]
  0x000002d3862e9000 JavaThread "ocr-10" [_thread_blocked, id=14712, stack(0x000000eb5f100000,0x000000eb5f200000)]
  0x000002d3862e7800 JavaThread "ocr-11" [_thread_blocked, id=2168, stack(0x000000eb5f000000,0x000000eb5f100000)]
  0x000002d3862ea000 JavaThread "ocr-12" [_thread_blocked, id=1172, stack(0x000000eb5ed00000,0x000000eb5ee00000)]
  0x000002d3862e4000 JavaThread "ocr-14" [_thread_blocked, id=11024, stack(0x000000eb5f400000,0x000000eb5f500000)]
  0x000002d3862ee800 JavaThread "ocr-15" [_thread_blocked, id=14160, stack(0x000000eb5f500000,0x000000eb5f600000)]
  0x000002d3862ef800 JavaThread "ocr-13" [_thread_blocked, id=9324, stack(0x000000eb5f600000,0x000000eb5f700000)]
  0x000002d3895c5000 JavaThread "ocr-16" [_thread_blocked, id=15012, stack(0x000000eb5f200000,0x000000eb5f300000)]
  0x000002d3895c0800 JavaThread "ocr-17" [_thread_blocked, id=12628, stack(0x000000eb5f300000,0x000000eb5f400000)]
  0x000002d3895c7800 JavaThread "ocr-18" [_thread_blocked, id=8884, stack(0x000000eb5ee00000,0x000000eb5ef00000)]
  0x000002d3895c2000 JavaThread "ocr-19" [_thread_blocked, id=3252, stack(0x000000eb5f700000,0x000000eb5f800000)]
  0x000002d3895c6000 JavaThread "ocr-20" [_thread_blocked, id=11080, stack(0x000000eb5f800000,0x000000eb5f900000)]
  0x000002d3895c8800 JavaThread "ocr-21" [_thread_blocked, id=8824, stack(0x000000eb5f900000,0x000000eb5fa00000)]
  0x000002d387763800 JavaThread "ocr-22" [_thread_blocked, id=11088, stack(0x000000eb5fd00000,0x000000eb5fe00000)]
  0x000002d38775e000 JavaThread "ocr-23" [_thread_blocked, id=10256, stack(0x000000eb5fc00000,0x000000eb5fd00000)]
  0x000002d38775f800 JavaThread "ocr-24" [_thread_blocked, id=11096, stack(0x000000eb60000000,0x000000eb60100000)]
  0x000002d3895c2800 JavaThread "ocr-25" [_thread_blocked, id=10192, stack(0x000000eb60200000,0x000000eb60300000)]
  0x000002d3895c3800 JavaThread "ocr-26" [_thread_blocked, id=12556, stack(0x000000eb5fa00000,0x000000eb5fb00000)]
  0x000002d3895c9800 JavaThread "ocr-27" [_thread_blocked, id=14208, stack(0x000000eb60400000,0x000000eb60500000)]
  0x000002d3895cb000 JavaThread "ocr-28" [_thread_blocked, id=14568, stack(0x000000eb60500000,0x000000eb60600000)]
  0x000002d3895cb800 JavaThread "ocr-29" [_thread_blocked, id=14552, stack(0x000000eb60600000,0x000000eb60700000)]
  0x000002d3894d0000 JavaThread "ocr-30" [_thread_blocked, id=12708, stack(0x000000eb60100000,0x000000eb60200000)]
  0x000002d3894d2800 JavaThread "SimpleAsyncTaskExecutor-2718" [_thread_blocked, id=14604, stack(0x000000eb61e00000,0x000000eb61f00000)]
  0x000002d3894d1000 JavaThread "SimpleAsyncTaskExecutor-2720" [_thread_in_native, id=14864, stack(0x000000eb62000000,0x000000eb62100000)]
=>0x000002d3862ec800 JavaThread "SimpleAsyncTaskExecutor-2725" [_thread_in_native, id=9996, stack(0x000000eb62500000,0x000000eb62600000)]

Other Threads:
  0x000002d3ff711000 VMThread "VM Thread" [stack: 0x000000eb58200000,0x000000eb58300000] [id=3408]
  0x000002d382f57800 WatcherThread [stack: 0x000000eb59500000,0x000000eb59600000] [id=11616]
  0x000002d3e5a39000 GCTaskThread "GC Thread#0" [stack: 0x000000eb57d00000,0x000000eb57e00000] [id=13800]
  0x000002d382e6c000 GCTaskThread "GC Thread#1" [stack: 0x000000eb58b00000,0x000000eb58c00000] [id=7888]
  0x000002d382e6c800 GCTaskThread "GC Thread#2" [stack: 0x000000eb58c00000,0x000000eb58d00000] [id=14660]
  0x000002d382e6d800 GCTaskThread "GC Thread#3" [stack: 0x000000eb58d00000,0x000000eb58e00000] [id=8928]
  0x000002d382e72000 GCTaskThread "GC Thread#4" [stack: 0x000000eb58e00000,0x000000eb58f00000] [id=5444]
  0x000002d382e73000 GCTaskThread "GC Thread#5" [stack: 0x000000eb58f00000,0x000000eb59000000] [id=11008]
  0x000002d382e79800 GCTaskThread "GC Thread#6" [stack: 0x000000eb59000000,0x000000eb59100000] [id=9408]
  0x000002d382e7a000 GCTaskThread "GC Thread#7" [stack: 0x000000eb59100000,0x000000eb59200000] [id=6584]
  0x000002d3e5a4a800 ConcurrentGCThread "G1 Main Marker" [stack: 0x000000eb57e00000,0x000000eb57f00000] [id=8380]
  0x000002d3e5a4b800 ConcurrentGCThread "G1 Conc#0" [stack: 0x000000eb57f00000,0x000000eb58000000] [id=13512]
  0x000002d3835e0000 ConcurrentGCThread "G1 Conc#1" [stack: 0x000000eb59d00000,0x000000eb59e00000] [id=12]
  0x000002d3fed79000 ConcurrentGCThread "G1 Refine#0" [stack: 0x000000eb58000000,0x000000eb58100000] [id=2440]
  0x000002d384f75000 ConcurrentGCThread "G1 Refine#1" [stack: 0x000000eb5cd00000,0x000000eb5ce00000] [id=7900]
  0x000002d384f67000 ConcurrentGCThread "G1 Refine#2" [stack: 0x000000eb5ce00000,0x000000eb5cf00000] [id=8432]
  0x000002d384f68000 ConcurrentGCThread "G1 Refine#3" [stack: 0x000000eb5cf00000,0x000000eb5d000000] [id=14600]
  0x000002d384f68800 ConcurrentGCThread "G1 Refine#4" [stack: 0x000000eb5d000000,0x000000eb5d100000] [id=12256]
  0x000002d384f69000 ConcurrentGCThread "G1 Refine#5" [stack: 0x000000eb5d100000,0x000000eb5d200000] [id=7508]
  0x000002d384f6a000 ConcurrentGCThread "G1 Refine#6" [stack: 0x000000eb5d200000,0x000000eb5d300000] [id=14452]
  0x000002d384f6a800 ConcurrentGCThread "G1 Refine#7" [stack: 0x000000eb5d300000,0x000000eb5d400000] [id=8784]
  0x000002d3fed7a000 ConcurrentGCThread "G1 Young RemSet Sampling" [stack: 0x000000eb58100000,0x000000eb58200000] [id=14744]

Threads with active compile tasks:

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap address: 0x00000000e0000000, size: 512 MB, Compressed Oops mode: 32-bit
Narrow klass base: 0x0000000000000000, Narrow klass shift: 3
Compressed class space size: 1073741824 Address: 0x0000000100000000

Heap:
 garbage-first heap   total 524288K, used 226609K [0x00000000e0000000, 0x0000000100000000)
  region size 1024K, 24 young (24576K), 14 survivors (14336K)
 Metaspace       used 95680K, capacity 98805K, committed 99244K, reserved 1134592K
  class space    used 12220K, capacity 13412K, committed 13568K, reserved 1048576K
Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, A=archive, TAMS=top-at-mark-start (previous, next)
|   0|0x00000000e0000000, 0x00000000e0100000, 0x00000000e0100000|100%|HS|  |TAMS 0x00000000e0100000, 0x00000000e0000000| Complete 
|   1|0x00000000e0100000, 0x00000000e0200000, 0x00000000e0200000|100%|HS|  |TAMS 0x00000000e0200000, 0x00000000e0100000| Complete 
|   2|0x00000000e0200000, 0x00000000e0300000, 0x00000000e0300000|100%|HC|  |TAMS 0x00000000e0300000, 0x00000000e0200000| Complete 
|   3|0x00000000e0300000, 0x00000000e0400000, 0x00000000e0400000|100%| O|  |TAMS 0x00000000e0400000, 0x00000000e0300000| Untracked 

[...]

| 510|0x00000000ffe00000, 0x00000000fff00000, 0x00000000fff00000|100%| E|CS|TAMS 0x00000000ffe00000, 0x00000000ffe00000| Complete 
| 511|0x00000000fff00000, 0x0000000100000000, 0x0000000100000000|100%| E|CS|TAMS 0x00000000fff00000, 0x00000000fff00000| Complete 

Card table byte_map: [0x000002d3fd1b0000,0x000002d3fd2b0000] _byte_map_base: 0x000002d3fcab0000

Marking Bits (Prev, Next): (CMBitMap*) 0x000002d3e5a47858, (CMBitMap*) 0x000002d3e5a47890
 Prev Bits: [0x000002d3fd3b0000, 0x000002d3fdbb0000)
 Next Bits: [0x000002d3fdbb0000, 0x000002d3fe3b0000)

Polling page: 0x000002d3e3970000

Metaspace:

Usage:
  Non-class:     83.39 MB capacity,    81.50 MB ( 98%) used,     1.53 MB (  2%) free+waste,   362.25 KB ( <1%) overhead. 
      Class:     13.10 MB capacity,    11.93 MB ( 91%) used,  1015.27 KB (  8%) free+waste,   175.81 KB (  1%) overhead. 
       Both:     96.49 MB capacity,    93.44 MB ( 97%) used,     2.53 MB (  3%) free+waste,   538.06 KB ( <1%) overhead. 

Virtual space:
  Non-class space:       84.00 MB reserved,      83.67 MB (>99%) committed 
      Class space:        1.00 GB reserved,      13.25 MB (  1%) committed 
             Both:        1.08 GB reserved,      96.92 MB (  9%) committed 

Chunk freelists:
   Non-Class:  27.38 KB
       Class:  11.38 KB
        Both:  38.75 KB

CodeHeap 'non-profiled nmethods': size=238336Kb used=23521Kb max_used=23521Kb free=214814Kb
 bounds [0x000002d3ee4c0000, 0x000002d3efbc0000, 0x000002d3fcd80000]
CodeHeap 'non-nmethods': size=7424Kb used=1900Kb max_used=1900Kb free=5523Kb
 bounds [0x000002d3edd80000, 0x000002d3edff0000, 0x000002d3ee4c0000]
 total_blobs=14705 nmethods=12914 adapters=1472
 compilation: enabled
              stopped_count=0, restarted_count=0
 full_count=0

VM Arguments:
jvm_args: -Djava.library.path=C:\prgm\opencv\build\java\x64 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=52870 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dspring.jmx.enabled=true -Dspring.application.admin.enabled=true -Xms512m -Xmx512m -Dorg.bytedeco.javacpp.maxbytes=8G -Dorg.bytedeco.javacpp.maxphysicalbytes=8G -Dexpl.mod=audit -Xverify:none -XX:TieredStopAtLevel=1 -Dspring.boot.project.name=ws_santorin_images -Dfile.encoding=UTF-8

---------------  S Y S T E M  ---------------

OS: Windows 10 , 64 bit Build 18362 (10.0.18362.329)

CPU:total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 model 94 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, rtm, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx, fma

Memory: 4k page, system-wide physical 16303M (2369M free)
TotalPageFile size 31449M (AvailPageFile size 7426M)
current process WorkingSet (physical memory assigned to process): 1355M, peak: 1955M
current process commit charge ("private bytes"): 2901M, peak: 9263M

vm_info: Java HotSpot(TM) 64-Bit Server VM (11.0.6+8-LTS) for windows-amd64 JRE (11.0.6+8-LTS), built on Dec 11 2019 09:17:57 by "mach5one" with MS VC++ 15.5 (VS2017)

END.

is there an other way to get result from model ?

return Nd4j.getBlasWrapper().iamax(resultFiltered) + "";

you can just use Nd4j.argmax. Not really sure why you are even using iamax in the first place.

The AVX warning is just a warning, either you set up your system to use AVX2 for a bit of a speed improvement, or if you just want to get rid of it set the environment variable as it advises you to do.

For the error log, it would have been nice if you used something like gist.github.com.

It looks like the crash happened during loading of an image, not during the actual inference. And it looks like you are running this from multiple threads too.

@saudet
Is the NativeImageLoader not threadsafe?

Ok next time i will put stack on your link :slight_smile:

I wanted to filter the result and take the best output. I did not manage to tune my model other than with a softmax activation, but in case the outputs were not equal to 1 or 0, iamax took all its importance. iamax is right there for cases where I don’t have only 0 and one 1 but 0.999 and 0.001 and 0 …
I’m pretty new in ML.

iamax return an int and argMax an INDArray so.

int code = ((int) 'A') + Nd4j.getBlasWrapper().iamax(resultFiltered);

don’t work with argMax.

@treo No, it’s not thread-safe.

1 Like

-15:20:39.108 - INFO — Starting MultiLayerNetwork with WorkspaceModes set to [training: ENABLED; inference: ENABLED], cacheMode set to [NONE]

what is cacheMode parameter and how can i change it if it improves performance ?

I think it’s legacy and can be removed now.

1 Like

You should probably still use resultFiltered.argMax().toIntVector()[0].

Thank you for the information :slight_smile:

@arnaud22, this is the reason for your crash. You have to use the Image Loader in a thread safe way.

1 Like

Thx @raver119 and @saudet

@treo yes it’s better with resultFiltered.argMax().toIntVector()[0] !

When we do that :

            NativeImageLoader loader = new NativeImageLoader(28, 28, 1);
            try (INDArray filtre = contructFiltre(elementsPossible, isChiffre);
                    INDArray imgAOCR = loader.asMatrix(img);
                    INDArray resultFiltered = model.output(imgAOCR).muli(filtre);) {
                if (isChiffre) {
                    return resultFiltered.argMax().toIntVector()[0] + "";
                } else {
                    return ((char) ((int) 'A') + resultFiltered.argMax().toIntVector()[0]) + "";
                }
            } catch (Exception e) {
                // On retourne _ comme si on avait rien trouvé
                LOG.warn("probleme lors de la recuperation d'un caracterate", e);
            }

imgAOCR is not close, is it normal ?
Thx for all your responses !

@treo For ParallelInference problem, when I don’t use Parallel Inference object it’s work but when i use it, I have the problem, maybe NativeImageLoader is not my only problem ?

I guess that it just makes the problem noticeable earlier. First make sure that you use the loader safely.

Hi @treo,

I think the loader is now safety but now i get this error :

Some ideas ?

Thx

PS : I remove ParallelInference for this test

This is weird. In principle model access is thread safe, as the access gets serialized across threads.

Does every one of your threads use its own model? Or are all of them using the same model?

@raver119 any other ideas what might be wrong here?

I load only one model, thanx for your quick response !

It’s impossible to tell anything based on this log. I need to have code that reproduces this problem