java3d memory leak with threads

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

java3d memory leak with threads

henry
Hi There,
  I am using McIDAS,  a large java program for displaying  weather/climate data.
  For 3d/2d rendering it uses the java3d API -  ( the two jars j3dcore and j3dutils.jar dated 2008)
 The program can run in two modes interactive and script mode.
  In script mode instructions  are taken from  python script and the main window is NOT displayed.
 ( nb this is NOT in headless mode)
 
 On our server the program runs fine in interactive mode  - but in script mode  when doing a batch job ; the program opens loads of threads (110-150)  and uses lots of heap memory ( 4GB)  and then eventually grinds to  halt .
( see threads at end of post)
On my local machine the batch jobs runs fine,


The sever specification is
server:
quad core Xeon running CentOS 6.4

Graphics card:
GeForce GT 610 (rev a1) - driver nvidia version 319.17

java- runtime:
 ( comes bundled with the McIDAS sofwtare)
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)



Any help or insight would be very greatly appreciated
..Henry

 Threads:

"J3D-BehaviorScheduler-1" prio=10 tid=0x00007fbe141d2000 nid=0xe99 in Object.wait() [0x00007fbe5055c000]
"J3D-BehaviorScheduler-2" prio=10 tid=0x00007fbe141d5000 nid=0x1095 in Object.wait() [0x00007fbe031f0000]
"J3D-BehaviorScheduler-3" prio=10 tid=0x00007fbe141be000 nid=0x1494 in Object.wait() [0x00007fbdff068000]
"J3D-BehaviorScheduler-4" prio=10 tid=0x00007fbe14040000 nid=0x190f in Object.wait() [0x00007fbdfdd2a000]
"J3D-BehaviorScheduler-5" prio=10 tid=0x00007fbe141a3000 nid=0x1c0a in Object.wait() [0x00007fbdfd225000]
"J3D-BehaviorStructureUpdateThread-1" prio=10 tid=0x00007fbe141a8800 nid=0xe94 in Object.wait() [0x00007fbe03cfb000]
"J3D-BehaviorStructureUpdateThread-2" prio=10 tid=0x00007fbe14187800 nid=0x1090 in Object.wait() [0x00007fbe5035a000]
"J3D-BehaviorStructureUpdateThread-3" prio=10 tid=0x00007fbe141de000 nid=0x148f in Object.wait() [0x00007fbdfec35000]
"J3D-BehaviorStructureUpdateThread-4" prio=10 tid=0x00007fbe1403c000 nid=0x190a in Object.wait() [0x00007fbdfe32c000]
"J3D-BehaviorStructureUpdateThread-5" prio=10 tid=0x00007fbe1419d800 nid=0x1c05 in Object.wait() [0x00007fbdfe029000]
"J3D-GeometryStructureUpdateThread-1" prio=10 tid=0x00007fbe141b0800 nid=0xe95 in Object.wait() [0x00007fbe03bfa000]
"J3D-GeometryStructureUpdateThread-2" prio=10 tid=0x00007fbe141c2000 nid=0x1091 in Object.wait() [0x00007fbe02ceb000]
"J3D-GeometryStructureUpdateThread-3" prio=10 tid=0x00007fbe141e6000 nid=0x1490 in Object.wait() [0x00007fbdfe730000]
"J3D-GeometryStructureUpdateThread-4" prio=10 tid=0x00007fbe1403c800 nid=0x190b in Object.wait() [0x00007fbdfdb28000]
"J3D-GeometryStructureUpdateThread-5" prio=10 tid=0x00007fbe1419e000 nid=0x1c06 in Object.wait() [0x00007fbdfcf22000]
"J3D-InputDeviceScheduler-1" prio=10 tid=0x00007fbe141b2800 nid=0xe9c in Object.wait() [0x00007fbe037f6000]
"J3D-InputDeviceScheduler-2" prio=10 tid=0x00007fbe141ad000 nid=0x1098 in Object.wait() [0x00007fbe032f1000]
"J3D-InputDeviceScheduler-3" prio=10 tid=0x00007fbe1404d000 nid=0x1497 in Object.wait() [0x00007fbdff268000]
"J3D-InputDeviceScheduler-4" prio=10 tid=0x00007fbe14044000 nid=0x1912 in Object.wait() [0x00007fbe50158000]
"J3D-InputDeviceScheduler-5" prio=10 tid=0x00007fbe1400a800 nid=0x1c0d in Object.wait() [0x00007fbdfe62f000]
"J3D-MasterControl-1" prio=10 tid=0x00007fbe2006d000 nid=0xe90 in Object.wait() [0x00007fbe02bea000]
"J3D-NotificationThread" prio=10 tid=0x00007fbe20061800 nid=0xe8f in Object.wait() [0x00007fbe035f4000]
"J3D-Renderer-1" prio=10 tid=0x00007fbe141ce800 nid=0xe91 in Object.wait() [0x00007fbe03efd000]
"J3D-RenderingAttributesStructureUpdateThread" prio=10 tid=0x00007fbe20055000 nid=0xe8d in Object.wait() [0x00007fbe50a61000]
"J3D-RenderingEnvironmentStructureUpdateThread-1" prio=10 tid=0x00007fbe141dc800 nid=0xe97 in Object.wait() [0x00007fbe5045b000]
"J3D-RenderingEnvironmentStructureUpdateThread-2" prio=10 tid=0x00007fbe141c8800 nid=0x1093 in Object.wait() [0x00007fbe51074000]
"J3D-RenderingEnvironmentStructureUpdateThread-3" prio=10 tid=0x00007fbe1419a800 nid=0x1492 in Object.wait() [0x00007fbdfe831000]
"J3D-RenderingEnvironmentStructureUpdateThread-4" prio=10 tid=0x00007fbe1403e000 nid=0x190d in Object.wait() [0x00007fbdfdc29000]
"J3D-RenderingEnvironmentStructureUpdateThread-5" prio=10 tid=0x00007fbe141a0800 nid=0x1c08 in Object.wait() [0x00007fbdfd124000]
"J3D-RenderStructureUpdateThread-1" prio=10 tid=0x00007fbe141d3800 nid=0xe9a in Object.wait() [0x00007fbe50259000]
"J3D-RenderStructureUpdateThread-2" prio=10 tid=0x00007fbe141c6800 nid=0x1096 in Object.wait() [0x00007fbe51175000]
"J3D-RenderStructureUpdateThread-3" prio=10 tid=0x00007fbe1404b000 nid=0x1495 in Object.wait() [0x00007fbe5085f000]
"J3D-RenderStructureUpdateThread-4" prio=10 tid=0x00007fbe14041000 nid=0x1910 in Object.wait() [0x00007fbdfde2b000]
"J3D-RenderStructureUpdateThread-5" prio=10 tid=0x00007fbe141a4800 nid=0x1c0b in Object.wait() [0x00007fbdfd427000]
"J3D-SoundSchedulerUpdateThread-1" prio=10 tid=0x00007fbe14198800 nid=0xe9b in Object.wait() [0x00007fbe030ef000]
"J3D-SoundSchedulerUpdateThread-2" prio=10 tid=0x00007fbe141d7000 nid=0x1097 in Object.wait() [0x00007fbe02fee000]
"J3D-SoundSchedulerUpdateThread-3" prio=10 tid=0x00007fbe1404b800 nid=0x1496 in Object.wait() [0x00007fbdfea33000]
"J3D-SoundSchedulerUpdateThread-4" prio=10 tid=0x00007fbe14042800 nid=0x1911 in Object.wait() [0x00007fbdfeb34000]
"J3D-SoundSchedulerUpdateThread-5" prio=10 tid=0x00007fbe141a6000 nid=0x1c0c in Object.wait() [0x00007fbdfe52e000]
"J3D-SoundStructureUpdateThread-1" prio=10 tid=0x00007fbe141d0800 nid=0xe96 in Object.wait() [0x00007fbe036f5000]
"J3D-SoundStructureUpdateThread-2" prio=10 tid=0x00007fbe141ca800 nid=0x1092 in Object.wait() [0x00007fbe5065d000]
"J3D-SoundStructureUpdateThread-3" prio=10 tid=0x00007fbe1419a000 nid=0x1491 in Object.wait() [0x00007fbdfe932000]
"J3D-SoundStructureUpdateThread-4" prio=10 tid=0x00007fbe1403d800 nid=0x190c in Object.wait() [0x00007fbdfee35000]
"J3D-SoundStructureUpdateThread-5" prio=10 tid=0x00007fbe1419f000 nid=0x1c07 in Object.wait() [0x00007fbdfe22b000]
"J3D-TimerThread" prio=10 tid=0x00007fbe20079000 nid=0xe8e in Object.wait() [0x00007fbe02ae9000]





 
 
Reply | Threaded
Open this post in threaded view
|

Re: java3d memory leak with threads

InteractiveMesh
At first sight:

 - Either the Java 3D application includes 5 VirtualUniverses and 5 Views or it consists of one VirtualUniverse/View and was started 5 times.

 - All Java 3D related threads are waiting because the engine stops if all Canvas3Ds are not visible ('main window is NOT displayed').

August
Reply | Threaded
Open this post in threaded view
|

Re: java3d memory leak with threads

gouessej
Administrator
In reply to this post by henry
Hi

henry wrote
  I am using McIDAS,  a large java program for displaying  weather/climate data.
  For 3d/2d rendering it uses the java3d API -  ( the two jars j3dcore and j3dutils.jar dated 2008)
Sorry, we only maintain Java3D 1.6 and it seems to use Java3D 1.5 which is out of our control:
http://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/#installation
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: java3d memory leak with threads

henry
In reply to this post by InteractiveMesh
Hi august,
 thank you for your rapid response
 The thing is despite the number of threads it runs quickly and efficently on my ubuntu box.
 I just want to replicate this type of performance on the server.
would using a more up to date version of java3d make any difference ?

What is more confusing is that despite the number of threads it can still finishes the script/batch job
The program MCIDAS is too huge for me to go in a start changing stuff

... Henry


 
Reply | Threaded
Open this post in threaded view
|

Re: java3d memory leak with threads

InteractiveMesh
Give the latest version a try: http://jogamp.org/deployment/java3d/1.6.0-pre9/. Probably you will then be treated more politely here.
Reply | Threaded
Open this post in threaded view
|

Re: java3d memory leak with threads

gouessej
Administrator
henry wrote
would using a more up to date version of java3d make any difference ?
You use a completely obsolete version whose maintenance had been stopped several years ago and which doesn't work on several recent operating systems. If you have any problem with this version, we won't be able to help you, no fix will be backported and anyway we don't build Java3D 1.5 anymore.

InteractiveMesh wrote
Give the latest version a try: http://jogamp.org/deployment/java3d/1.6.0-pre9/. Probably you will then be treated more politely here.
My article already contains the links to the latest JARs. I haven't been unpolite with him, using unmaintained pieces of softwares in production is very dangerous and this is typically the kind of things I want to avoid. I don't want to hurt anybody. We are some friendly members and we have to do our best to help the users of our APIs. Java3D 1.5 isn't maintained anymore, what can I do to help him as a first step instead of advising him to use our version? I'm not Oracle / Sun Microsystems, Java3D 1.5 is none of my concerns.

Edit.: Reminder: This section of the forum is entitled "JogAmp's Java3D Continuation" which means Java3D 1.6.x and later versions. Earlier versions are not maintained by JogAmp. If you want to get some help here, use our version, do it not to please me, do it because those earlier versions are unmaintained, you won't get any help on them and it would be completely nonsensical to expect any bug fix in Java3D versions that JogAmp is unable to build. Sorry to be unpolite enough to remind this.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: java3d memory leak with threads

henry
HI Julien and August,
   I'm sorry - I did not mean to offend anybody.
   I''m just C/C++ programmer who has stepped out of comfort zone and got bitten.

   I've checked the version of java3d  i am using and it is v 1.5 . So what you are saying is that your 1.6 version is not backwardly compatible and   if I want to use  v1.6 then I'll have to recode

   McIDAS is a large programs and on start up loads over 10,000 classes - most of it is open source
   It is maintained by the Space Science and Engineering Center at the University of  wisconsin
   
   I would just like some idea of the scale of the task before I start !
  Is it just a mater of changing a few method calls or is there a paradigm shift ?

  Many thanks
... Henry
Reply | Threaded
Open this post in threaded view
|

Re: java3d memory leak with threads

Xerxes Rånby
2013-12-16 15:58, henry [via jogamp] skrev:

> HI Julien and August,
>    I'm sorry - I did not mean to offend anybody.
>    I''m just C/C++ programmer who has stepped out of comfort zone and got bitten.
>
>    I've checked the version of java3d  i am using and it is v 1.5 . So what you are saying is that your 1.6 version is not backwardly compatible and   if I want to use  v1.6 then I'll have to recode
>
>    McIDAS is a large programs and on start up loads over 10,000 classes - most of it is open source
>    It is maintained by the Space Science and Engineering Center at the University of  wisconsin
>    
>    I would just like some idea of the scale of the task before I start !
>   Is it just a mater of changing a few method calls or is there a paradigm shift ?
>
>   Many thanks
> ... Henry
>

You only need to add the new Java3D 1.6 jar(s)
    j3dcore.jar
    j3dutils.jar
    vecmath.jar
and the jogamp jar(s)
    jogl-all.jar
    jogl-all-natives-linux-amd64.jar
    jogl-all-natives-linux-i586.jar
    jogl-all-natives-macosx-universal.jar
    jogl-all-natives-windows-amd64.jar
    jogl-all-natives-windows-i586.jar
    joal.jar
    joal-natives-linux-amd64.jar
    joal-natives-linux-i586.jar
    joal-natives-macosx-universal.jar
    joal-natives-windows-amd64.jar
    joal-natives-windows-i586.jar
    gluegen-rt.jar
    gluegen-rt-natives-linux-amd64.jar
    gluegen-rt-natives-linux-i586.jar
    gluegen-rt-natives-macosx-universal.jar
    gluegen-rt-natives-windows-amd64.jar
    gluegen-rt-natives-windows-i586.jar
to your classpath, the Java3D API is identical and your application should work without any code change.
http://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/#installation

Deployment will be easier because you can bundle all Java3D 1.6 and JogAmp jars with your application.

You no longer need to install java3d manually on the clients.
We recommend that you un-install the old java3d 1.5 version from the clients.

Cheers
Xerxes
Reply | Threaded
Open this post in threaded view
|

Re: java3d memory leak with threads

henry
Thank you Xerxes
I'll get cracking !!
Reply | Threaded
Open this post in threaded view
|

Re: java3d memory leak with threads

henry
HI August,
  I tried java3d V1.6 but it made no difference to the number of threads open.
  Your initial prognosis seems correct.
  Any ideas how I go about fixing it ?
 ... Henry
 
Reply | Threaded
Open this post in threaded view
|

Re: java3d memory leak with threads

InteractiveMesh
Beside the five Java 3D core threads another 9 threads will be created for each McIDAS-V view-tab because each one includes a VirtualUniverse, View, and Canvas3D instance.

In case of 10 view-tabs the JConsole monitor reports 124 threads in total and a non-/heap memory usage of 300 MB (without any loaded data).  

As of my experiences with other Java 3D multi-view applications such a number of threads and its memory consumption don't cause real problems.

While running McIDAS-V the core threads and only the threads of the visible view-tab are running on demand, all other are waiting.

I can't provide any feedback concerning the influence of the python script.

August
Reply | Threaded
Open this post in threaded view
|

Re: java3d memory leak with threads

henry
Hi August -
thank you very much for your input
...Henry
Reply | Threaded
Open this post in threaded view
|

Re: java3d memory leak with threads

gouessej
Administrator
Henry, can't you at least disable the sound? I assume you don't need that.
Julien Gouesse | Personal blog | Website