Fatal error when re-drawing lots of polygons on GraphicsLayer !

4668
6
06-19-2015 07:16 AM
JeremieJoalland
New Contributor II

We have issues with our application about performance and stability. For the mapping part, I've reproduce a sample code to perform stress-test, and identified following issues.

my project context :

Java8u40, ArcGIS Runtime 10.2.3, Application JavaFX, JMap is displayed in a JavaFx SwingNode, RxJava for reactive programming. Running on JRE 32bits. PC is Windows 7 Pro SP1, OS 64 bits, RAM 16 Go, Processor Intel Code CPU @ 3,40 Ghz.

my sample code :

1 JavaFx Stage with 1 button and 1 JMap (in a SwingNode). Basemap is a WMS (through MapServer) World map in Spatial Reference WGS 84. When Map is Ready, you can click on the "START POC" button to :

- create 10,000 polygons (ellipsis of 50 segments) on 1 Dynamic GraphicsLayer,

- create 10,000 points (center of each ellipsis) on 1 another Dynamic GraphicsLayer

- Then an update Cycle is started to perform every 30 seconds :

    - move 2,000 polygons,

    - move 2,000 points.

[sample  code / project is attached to this post]

my results  (log files are attached) on "START" button :

- Case 1: with JVM params -Xms256m -Xmx512m : program crash after 4h20min (after update iteration #530) with java.lang.OutOfMemory + EXCEPTION_ACCESS_VIOLATION  + "The crash happened outside the Java Virtual Machine in native code."

- Case 2: with JVM params -Xms256m -Xmx800m : program crash with same reason, but after 1h15min (update iteration #150)

- Case 3: with JVM params -Xms1024m -Xmx1024m : program crash at the beginning with following Exception : Exception in Thread "AWT-EventQueue-0" java.lang.Exception: Buffer_loader_cache: map_buffer ERROR, cannot create staging resource !

- Case 4: with JVM params -Xms1000m -Xmx1000m : program crash at the beginning with following Exception : Exception in Thread "AWT-EventQueue-0" java.lang.Exception: Failed to resize vertex buffer !

in method ...JMap.nativeDrawMapDirectToBuffer...

- Case 5: upgrade to ArcGIS Runtime 10.2.4, with JVM params -Xms256m -Xmx 512m : program crash when trying to draw the polygons for the first time, with same fatal error Exception.

It surprised me that increasing max heap size of JVM get my program crashing faster... I was also not expecting that upgrading in ArcGIS Runtime 10.2.4 not improve the program.

Could anyone provide me with some explanations for these issues ? are there known limitations to ArcGIS Runtime with GraphicsLayer that explain these results ? any solutions ?

6 Replies
JeremieJoalland
New Contributor II

I still got random exception on our application when executing some scenarize tests on our Continuous Integration environment : Does anyone as ever encountered this exception "Failed to resize vertex buffer" ???

[MY_TEST] [AWT-EventQueue-0] ERROR c.t.e.a.a.u.ATestRule:56 - Exception on Thread [AWT-EventQueue-0,6,main]

java.lang.RuntimeException: Failed to resize vertex buffer

    at com.esri.map.JMap.nativeDrawMapDirectToBuffer(Native Method) ~[arcgis-runtime-10.2.3.jar:na]

    at com.esri.map.JMap.paintComponent(Unknown Source) ~[arcgis-runtime-10.2.3.jar:na]

    at javax.swing.JComponent.paint(JComponent.java:1056) ~[na:1.8.0_40]

    at com.esri.map.JMap.paint(Unknown Source) ~[arcgis-runtime-10.2.3.jar:na]

    at javax.swing.JComponent.paintChildren(JComponent.java:889) ~[na:1.8.0_40]

    at javax.swing.JComponent.paint(JComponent.java:1065) ~[na:1.8.0_40]

    at javax.swing.JComponent.paintChildren(JComponent.java:889) ~[na:1.8.0_40]

    at javax.swing.JComponent.paint(JComponent.java:1065) ~[na:1.8.0_40]

    at javax.swing.JComponent.paintChildren(JComponent.java:889) ~[na:1.8.0_40]

    at javax.swing.JComponent.paint(JComponent.java:1065) ~[na:1.8.0_40]

    at sun.swing.JLightweightFrame$3.paint(JLightweightFrame.java:307) ~[na:1.8.0_40]

    at javax.swing.JComponent.paintToOffscreen(JComponent.java:5219) ~[na:1.8.0_40]

    at javax.swing.RepaintManager.paint(RepaintManager.java:1268) ~[na:1.8.0_40]

    at javax.swing.JComponent._paintImmediately(JComponent.java:5167) ~[na:1.8.0_40]

    at javax.swing.JComponent.paintImmediately(JComponent.java:4978) ~[na:1.8.0_40]

    at javax.swing.JComponent.paintImmediately(JComponent.java:4959) ~[na:1.8.0_40]

    at javax.swing.RepaintManager$4.run(RepaintManager.java:824) ~[na:1.8.0_40]

    at javax.swing.RepaintManager$4.run(RepaintManager.java:807) ~[na:1.8.0_40]

    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_40]

    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) ~[na:1.8.0_40]

    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:807) ~[na:1.8.0_40]

    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:782) ~[na:1.8.0_40]

    at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:731) ~[na:1.8.0_40]

    at javax.swing.RepaintManager.access$1300(RepaintManager.java:64) ~[na:1.8.0_40]

    at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1720) ~[na:1.8.0_40]

    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) ~[na:1.8.0_40]

    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:749) ~[na:1.8.0_40]

    at java.awt.EventQueue.access$500(EventQueue.java:97) ~[na:1.8.0_40]

    at java.awt.EventQueue$3.run(EventQueue.java:702) ~[na:1.8.0_40]

    at java.awt.EventQueue$3.run(EventQueue.java:696) ~[na:1.8.0_40]

    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_40]

    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) ~[na:1.8.0_40]

    at java.awt.EventQueue.dispatchEvent(EventQueue.java:719) ~[na:1.8.0_40]

    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) [na:1.8.0_40]

    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [na:1.8.0_40]

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [na:1.8.0_40]

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [na:1.8.0_40]

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [na:1.8.0_40]

    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [na:1.8.0_40]

later on, my test terminate on fatal error :

#

# A fatal error has been detected by the Java Runtime Environment:

#

SUREFIRE-859: #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x63658f64, pid=10108, tid=7200

#

# JRE version: Java(TM) SE Runtime Environment (8.0_40-b26) (build 1.8.0_40-b26)

# Java VM: Java HotSpot(TM) Client VM (25.40-b25 mixed mode windows-x86 )

# Problematic frame:

# C  [runtimecore_java.dll+0x4c8f64]

#

# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

#

# An error report file with more information is saved as:

# C:\jenkins\workspace\aers.atest.slave.full\atest\hs_err_pid10108.log

#

SUREFIRE-859: # 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.

#

java.lang.OutOfMemoryError

0 Kudos
BatbayarBazarragchaa
New Contributor III

Have you resolved your issue? I'm using SDK 10.2.4 and its crashing immediately when I draw map.

0 Kudos
EricBader
Occasional Contributor III

Is the crash happening on Windows or Linux?

0 Kudos
BatbayarBazarragchaa
New Contributor III

I'm using Windows with JDK 1.8. I tried running with 32bit and 64bit JRE's and the result is nearly same.

#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x4e44350b, pid=13136, tid=0x00000318
#
# JRE version: Java(TM) SE Runtime Environment (8.0_112-b15) (build 1.8.0_112-b15)
# Java VM: Java HotSpot(TM) Server VM (25.112-b15 mixed mode windows-x86 )
# Problematic frame:
# C [runtimecore_java.dll+0xa350b]
#
# Failed to write core dump. 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.
#

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

Current thread (0x470ee000): JavaThread "AWT-EventQueue-0" [_thread_in_native, id=792, stack(0x4a130000,0x4a530000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000008

Registers:
EAX=0x00000004, EBX=0x4472573c, ECX=0x4a52d478, EDX=0x00000000
ESP=0x4a52d434, EBP=0x4a52d44c, ESI=0x4a52d478, EDI=0x53d3623c
EIP=0x4e44350b, EFLAGS=0x00010202

Top of Stack: (sp=0x4a52d434)
0x4a52d434: 53d3623c 53d362d8 4472573c 00000000
0x4a52d444: 80000000 00000000 4a52d460 4e443415
0x4a52d454: 00000004 00000004 00000000 4a52d490
0x4a52d464: 4e9d03e3 4a52d478 3ae67eec 53d3623c
0x4a52d474: 53d362d8 00000000 00000000 00000000
0x4a52d484: 4a52d624 4ee39b48 ffffffff 4a52d4ac
0x4a52d494: 4e9cdb5b 4472573c 445db68c 4472573c
0x4a52d4a4: 4472573c 01d3623c 4a52d638 4e5a33a2

Instructions: (pc=0x4e44350b)
0x4e4434eb: cc cc cc cc cc 55 8b ec 8b 45 08 83 ec 0c 53 56
0x4e4434fb: 8b f1 57 c7 06 00 00 00 00 c7 46 04 00 00 00 00
0x4e44350b: 8b 78 04 8b 18 85 ff 74 1f 8b cf e8 35 88 f8 ff
0x4e44351b: 84 c0 74 14 57 53 8b ce e8 68 33 f7 ff 5f 8b c6


Register to memory mapping:

EAX=0x00000004 is an unknown value
EBX=0x4472573c is an unknown value
ECX=0x4a52d478 is pointing into the stack for thread: 0x470ee000
EDX=0x00000000 is an unknown value
ESP=0x4a52d434 is pointing into the stack for thread: 0x470ee000
EBP=0x4a52d44c is pointing into the stack for thread: 0x470ee000
ESI=0x4a52d478 is pointing into the stack for thread: 0x470ee000
EDI=0x53d3623c is an unknown value


Stack: [0x4a130000,0x4a530000], sp=0x4a52d434, free space=4085k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [runtimecore_java.dll+0xa350b]
C [runtimecore_java.dll+0xa3415]
C [runtimecore_java.dll+0x6303e3]
C [runtimecore_java.dll+0x62db5b]
C [runtimecore_java.dll+0x2033a2]
C [runtimecore_java.dll+0x1e8117]
C [runtimecore_java.dll+0x92e74]
C [runtimecore_java.dll+0x935e2]
j com.esri.map.MapCore.nativeDrawMapDirectToBuffer(JII[I)V+0
j com.esri.map.MapCore.a(II[I)V+8
j com.esri.map.JMap.paintComponent(Ljava/awt/Graphics;)V+109
J 7307 C1 javax.swing.JComponent.paint(Ljava/awt/Graphics;)V (409 bytes) @ 0x040ec120 [0x040eae20+0x1300]
j com.esri.map.JMap.paint(Ljava/awt/Graphics;)V+25
J 7309 C1 javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V (669 bytes) @ 0x040e6894 [0x040e4140+0x2754]
J 7307 C1 javax.swing.JComponent.paint(Ljava/awt/Graphics;)V (409 bytes) @ 0x040ec4dc [0x040eae20+0x16bc]
J 7309 C1 javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V (669 bytes) @ 0x040e6894 [0x040e4140+0x2754]
J 7307 C1 javax.swing.JComponent.paint(Ljava/awt/Graphics;)V (409 bytes) @ 0x040ec4dc [0x040eae20+0x16bc]
J 7309 C1 javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V (669 bytes) @ 0x040e6894 [0x040e4140+0x2754]
J 7307 C1 javax.swing.JComponent.paint(Ljava/awt/Graphics;)V (409 bytes) @ 0x040ec4dc [0x040eae20+0x16bc]
j org.netbeans.swing.tabcontrol.TabbedContainer.paint(Ljava/awt/Graphics;)V+53
J 7309 C1 javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V (669 bytes) @ 0x040e6894 [0x040e4140+0x2754]
J 7307 C1 javax.swing.JComponent.paint(Ljava/awt/Graphics;)V (409 bytes) @ 0x040ec4dc [0x040eae20+0x16bc]
J 7309 C1 javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V (669 bytes) @ 0x040e6894 [0x040e4140+0x2754]
J 7307 C1 javax.swing.JComponent.paint(Ljava/awt/Graphics;)V (409 bytes) @ 0x040ec4dc [0x040eae20+0x16bc]
J 7309 C1 javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V (669 bytes) @ 0x040e6894 [0x040e4140+0x2754]
J 7307 C1 javax.swing.JComponent.paint(Ljava/awt/Graphics;)V (409 bytes) @ 0x040ec4dc [0x040eae20+0x16bc]
J 7309 C1 javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V (669 bytes) @ 0x040e6894 [0x040e4140+0x2754]
J 7307 C1 javax.swing.JComponent.paint(Ljava/awt/Graphics;)V (409 bytes) @ 0x040ec4dc [0x040eae20+0x16bc]
J 7309 C1 javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V (669 bytes) @ 0x040e6894 [0x040e4140+0x2754]
J 7307 C1 javax.swing.JComponent.paint(Ljava/awt/Graphics;)V (409 bytes) @ 0x040ec4dc [0x040eae20+0x16bc]
J 7309 C1 javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V (669 bytes) @ 0x040e6894 [0x040e4140+0x2754]
J 7307 C1 javax.swing.JComponent.paint(Ljava/awt/Graphics;)V (409 bytes) @ 0x040ec4dc [0x040eae20+0x16bc]
j javax.swing.JLayeredPane.paint(Ljava/awt/Graphics;)V+73
J 7309 C1 javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V (669 bytes) @ 0x040e6894 [0x040e4140+0x2754]
J 7307 C1 javax.swing.JComponent.paint(Ljava/awt/Graphics;)V (409 bytes) @ 0x040ec4dc [0x040eae20+0x16bc]
j javax.swing.JComponent.paintToOffscreen(Ljava/awt/Graphics;IIIIII)V+41
j javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Ljavax/swing/JComponent;Ljava/awt/Image;Ljava/awt/Graphics;IIII)V+163
j javax.swing.RepaintManager$PaintManager.paint(Ljavax/swing/JComponent;Ljavax/swing/JComponent;Ljava/awt/Graphics;IIII)Z+116
j javax.swing.RepaintManager.paint(Ljavax/swing/JComponent;Ljavax/swing/JComponent;Ljava/awt/Graphics;IIII)V+51
j javax.swing.JComponent._paintImmediately(IIII)V+683
j javax.swing.JComponent.paintImmediately(IIII)V+138
j javax.swing.RepaintManager$4.run()Ljava/lang/Void;+81
j javax.swing.RepaintManager$4.run()Ljava/lang/Object;+1
v ~StubRoutines::call_stub
V [jvm.dll+0x16f685]
V [jvm.dll+0x242d8e]
V [jvm.dll+0x16f71e]
V [jvm.dll+0x117ecf]
C [java.dll+0x102f]
J 4919 C1 java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object; (22 bytes) @ 0x03ebf7c8 [0x03ebf440+0x388]
j javax.swing.RepaintManager.paintDirtyRegions(Ljava/util/Map;)V+154
j javax.swing.RepaintManager.paintDirtyRegions()V+46
j javax.swing.RepaintManager.prePaintDirtyRegions()V+73
j javax.swing.RepaintManager.access$1200(Ljavax/swing/RepaintManager;)V+1
j javax.swing.RepaintManager$ProcessingRunnable.run()V+37
J 5854 C1 java.awt.event.InvocationEvent.dispatch()V (69 bytes) @ 0x03a4a710 [0x03a4a560+0x1b0]
J 5947 C1 java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V (149 bytes) @ 0x03f3163c [0x03f30120+0x151c]
J 5824 C1 java.awt.EventQueue$3.run()Ljava/lang/Void; (60 bytes) @ 0x03312638 [0x033124a0+0x198]
J 5823 C1 java.awt.EventQueue$3.run()Ljava/lang/Object; (5 bytes) @ 0x0386c610 [0x0386c5a0+0x70]
v ~StubRoutines::call_stub
V [jvm.dll+0x16f685]
V [jvm.dll+0x242d8e]
V [jvm.dll+0x16f71e]
V [jvm.dll+0x117ecf]
C [java.dll+0x102f]
J 5820 C1 java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V (80 bytes) @ 0x03850858 [0x038500e0+0x778]
J 5876 C1 org.netbeans.core.TimableEventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V (43 bytes) @ 0x035abff0 [0x035abf20+0xd0]
J 5826 C1 java.awt.EventDispatchThread.pumpOneEventForFilters(I)V (295 bytes) @ 0x03878b0c [0x03877360+0x17ac]
j java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+35
j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j java.awt.EventDispatchThread.run()V+9
v ~StubRoutines::call_stub
V [jvm.dll+0x16f685]
V [jvm.dll+0x242d8e]
V [jvm.dll+0x16f71e]
V [jvm.dll+0x16f8a6]
V [jvm.dll+0x16f917]
V [jvm.dll+0x10bf6f]
V [jvm.dll+0x193eb0]
V [jvm.dll+0x19473a]
V [jvm.dll+0x1d9396]
C [MSVCR100.dll+0x5c556]
C [MSVCR100.dll+0x5c600]
C [KERNEL32.DLL+0x162c4]
C [ntdll.dll+0x60fd9]
C [ntdll.dll+0x60fa4]
C 0x00000000

0 Kudos
EricBader
Occasional Contributor III

Thank you for providing all of this information. This sounds like a bug. Have you ccontacted tech support about this? They will log an issue for you that we can address...

BatbayarBazarragchaa
New Contributor III

How should I contact tech support? Go Esri Support Apps here and create a case? Or send email with the log and how to reproduce the issue?

It also crashes immediately when I change max heap memory by J-Xmx argument. It was fine on 768MB, but when I increase to 1024M it crashes, after that even 768MB not working.

0 Kudos