The Map View constantly resets itself
See original GitHub issuePrerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Running the latest version of Constellation
- Attached the Support Package via
Help >
Support Package` - Checked the FAQs: https://github.com/constellation-app/constellation/faq
- Checked that your issue isn’t already filed: https://github.com/constellation-app/constellation/issues
- Checked that there is not already a module that provides the described functionality: https://github.com/constellation-app/constellation/repositories-catalog
Description
Resizing the Map View forces it to completely reset itself - this gives you a way to deal with some GL related issues that can occur. I have noticed on certain displays that the Map View gets into a state where it constantly resets itself, making it impossible to use.
An exception when you continuously resize the map view is the following exception:
SEVERE [global] java.lang.RuntimeException: Number of texture units not supported by this hardware (or driver) Read http://wiki.processing.org/w/OpenGL_Issues for help. at processing.opengl.PGL.bindTexture(PGL.java:3235) at processing.opengl.Texture.allocate(Texture.java:1147) at processing.opengl.Texture.init(Texture.java:213) at processing.opengl.Texture.<init>(Texture.java:171) at processing.opengl.PGraphicsOpenGL.loadTextureImpl(PGraphicsOpenGL.java:5921) at processing.opengl.PGraphicsOpenGL.initOffscreen(PGraphicsOpenGL.java:6602) at processing.opengl.PGraphicsOpenGL.beginOffscreenDraw(PGraphicsOpenGL.java:6654) at processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:1461) at de.fhpotsdam.unfolding.mapdisplay.Java2DMapDisplay.draw(Java2DMapDisplay.java:351) at de.fhpotsdam.unfolding.UnfoldingMap.draw(UnfoldingMap.java:366) at au.gov.asd.tac.constellation.mapview.MapViewTileRenderer.draw(MapViewTileRenderer.java:525) at processing.core.PApplet.handleDraw(PApplet.java:2437) at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:859) at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692) at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674) at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147) at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759) at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81) at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452) at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178) at java.util.TimerThread.mainLoop(Timer.java:555) [catch] at java.util.TimerThread.run(Timer.java:505) {code} {code:java} SEVERE [global] java.lang.NullPointerException at au.gov.asd.tac.constellation.display.renderer.batcher.Batch.connectIntBuffer(Batch.java:475) at au.gov.asd.tac.constellation.display.renderer.batcher.IconBatcher.lambda$updateIcons$1(IconBatcher.java:122) at au.gov.asd.tac.constellation.display.renderer.batcher.SceneBatcher.lambda$updateIntBufferTask$0(SceneBatcher.java:160) at au.gov.asd.tac.constellation.display.renderer.GraphRenderable.lambda$addTaskIfReady$0(GraphRenderable.java:115) at au.gov.asd.tac.constellation.display.renderer.GraphRenderable.lambda$update$29(GraphRenderable.java:376) at java.util.ArrayList.forEach(Unknown Source) at au.gov.asd.tac.constellation.display.renderer.GraphRenderable.update(GraphRenderable.java:375) at au.gov.asd.tac.constellation.display.renderer.GLRenderer.lambda$display$2(GLRenderer.java:164) at java.util.ArrayList.forEach(Unknown Source) at au.gov.asd.tac.constellation.display.renderer.GLRenderer.display(GLRenderer.java:163) at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692) at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674) at com.jogamp.opengl.awt.GLCanvas$11.run(GLCanvas.java:1424) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293) Caused: com.jogamp.opengl.GLException: Caught NullPointerException: null on thread AWT-EventQueue-0 at com.jogamp.opengl.GLException.newGLException(GLException.java:76) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1327) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147) at com.jogamp.opengl.awt.GLCanvas$12.run(GLCanvas.java:1438) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Caused: java.lang.RuntimeException at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58) at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103) at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:201) at com.jogamp.opengl.Threading.invokeOnOpenGLThread(Threading.java:202) at com.jogamp.opengl.Threading.invoke(Threading.java:221) at com.jogamp.opengl.awt.GLCanvas.display(GLCanvas.java:505) at au.gov.asd.tac.constellation.display.renderer.GLVisualProcessor.performVisualUpdate(GLVisualProcessor.java:195) at au.gov.asd.tac.constellation.visualsupport.display.VisualProcessor.lambda$update$0(VisualProcessor.java:211)
The Map view can caused Constellation to run sluggishly and can do with a revisit to how things could be improved. An immediate improvement would be to not have the map view reload continuously as it is being resized.
Related stack trace
java.lang.RuntimeException: Waited 5000ms for: <6494c6f7, 21965401>[count 2, qsz 0, owner <AWT-EventQueue-0-FPSAWTAnimator#00-Timer0>] - <AWT-EventQueue-0-Display-.windows_nil-1-EDT-1> at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198) at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:1234) at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:1318) at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:145) at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:375) Caused: java.lang.RuntimeException at jogamp.newt.DefaultEDTUtil.invokeImpl(DefaultEDTUtil.java:252) at jogamp.newt.DefaultEDTUtil.invoke(DefaultEDTUtil.java:165) at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:442) at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2782) at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1330) at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1335) at com.jogamp.newt.opengl.GLWindow.setVisible(GLWindow.java:578) at com.jogamp.newt.awt.NewtCanvasAWT.detachNewtChild(NewtCanvasAWT.java:1099) at com.jogamp.newt.awt.NewtCanvasAWT.destroyImpl(NewtCanvasAWT.java:701) at com.jogamp.newt.awt.NewtCanvasAWT.removeNotify(NewtCanvasAWT.java:660) at java.awt.Container.remove(Unknown Source) at java.awt.Container.remove(Unknown Source) at javax.swing.JViewport.remove(Unknown Source) at javax.swing.JViewport.setView(Unknown Source) at javax.swing.JScrollPane.setViewportView(Unknown Source) at au.gov.asd.tac.constellation.mapview.MapViewTopComponent.lambda$resetContent$37(MapViewTopComponent.java:498) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) [catch] at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Sourc) at java.awt.EventDispatchThread.run(Unknown Source)
Steps to Reproduce
- Open the Map View
- Click and drag the Map View pane to resize it horizontally repeatedly
Expected behaviour: The Map View resizes without an error or unnecessary CPU/GPU stress
Actual behaviour: The graphics card buffer fills up and causes Constellation to crash
Reproduces how often: 100%
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top GitHub Comments
@formalhaut69 great work persisting and debugging this. I’d agree that I think it is that the buffers are written to without clearing, causing it to overflow.
Not sure. The Map view is OpenGL bases as you’ve found however it uses a different implementation to the graph. The Map view uses Unfolding Maps which uses an OpenGL library called Processing.
Can you have a look at https://processing.org/reference/clear_.html and see if you can get access to the
PGraphics
object. There might be a call to do this from the Unfolding map classes and @cygnus-x-1 is the best person to help with that.Legend. I’ve done some testing and it’s looking much better.
@aldebaran30701 and I have been able to implement a delay of half a second so the map now refreshes at an acceptable rate. This does make it much more difficult to fill up the graphics buffer and cause a crash but it can still occur. So it appears to be only a partial solution and doesn’t solve the underlying problem. I think what the underlying issue is that the graphics buffer isn’t being cleared properly. This is just a guess because I don’t know how the buffer works but I’m assuming that it’s supposed to be filled up with tasks to complete. What seems to be occurring though, is that the tasks are being completed because the map view is being refreshed and so this leads me to believe that the buffer isn’t being emptied correctly. @arcturus2 Do you think that this is the case? And if so, how could I potentially access the graphics buffer to clear it? I’ll make a pull request so you can take a look at it.