Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClearVolume leaves thread FPSAWTAnimator running after closing #68

Open
nicost opened this issue Feb 10, 2018 · 6 comments
Open

ClearVolume leaves thread FPSAWTAnimator running after closing #68

nicost opened this issue Feb 10, 2018 · 6 comments

Comments

@nicost
Copy link
Contributor

nicost commented Feb 10, 2018

Creating a ClearVolume Renderer (using ClearVolumeRendererFactory.newOpenCLRenderer()) and closing it again using close() leaves a thread named AWT-EventQueue-0-FPSAWTAnimator#00-Time0 running. Not a big deal, but opening and closing several viewers leads to a long list of threads, which consume resources, and eventually lead to instability. Google shows this thread seems to be created by jocl. I have been trying to follow the code to find out who spins up this thread, and who is not closing it down, but was unable to trace through all the interfaces and various projects. Anyone any ideas?

@royerloic
Copy link
Member

royerloic commented Feb 11, 2018 via email

@nicost nicost changed the title ClearVolume leaves thread running FPSAWTAnimator running after closing ClearVolume leaves thread FPSAWTAnimator running after closing Feb 11, 2018
@nicost
Copy link
Contributor Author

nicost commented Feb 11, 2018

That workaround may be possible. It adds extra overhead to keep track of renderers, and the expense in creating and destruction did not appear to be an issue so far. The number of Renderlayers can also change (as that corresponds to the number of channels in an acquisition), so keeping track of which ones are no longer in use and would fit whatever is requested would be a pain and could easily lead to bugs.

@royerloic
Copy link
Member

royerloic commented Feb 11, 2018 via email

@nicost
Copy link
Contributor Author

nicost commented Feb 16, 2018

Maybe helpful, just noted the following on the system output after closing Micro-Manager. Could it be that the NativeWindowFactory is not shutdown when calling close() on the Renderer?

Thread 76 (AWT-EventQueue-0-FPSAWTAnimator#02-Timer2) terminated with uncaught exception
java.lang.ThreadDeath
at java.lang.Thread.stop(Thread.java:853)
at com.jogamp.newt.opengl.GLWindow$GLLifecycleHook$1.run(GLWindow.java:724)
at java.security.AccessController.doPrivileged(Native Method)
at com.jogamp.newt.opengl.GLWindow$GLLifecycleHook.shutdownRenderingAction(GLWindow.java:719)
at jogamp.newt.WindowImpl.shutdown(WindowImpl.java:635)
at jogamp.newt.WindowImpl.shutdownAll(WindowImpl.java:123)
at jogamp.newt.DisplayImpl$1.run(DisplayImpl.java:74)
at com.jogamp.nativewindow.NativeWindowFactory.shutdown(NativeWindowFactory.java:272)
at com.jogamp.nativewindow.NativeWindowFactory$2$1.run(NativeWindowFactory.java:190)
at java.lang.Thread.run(Thread.java:748)

@royerloic
Copy link
Member

royerloic commented Feb 16, 2018 via email

@skalarproduktraum
Copy link
Member

Hey @royerloic and @nicost,

I've been fighting this issue also in scenery for some time and couldn't really find a solution, apart from catching ThreadDeath. Processing seemed to have a similar issue, see processing/processing#3293 and processing/processing@fff190b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants