Sorry, I forgot to mention that in all my current test cases I&#39;m calling the method cleanSystem(false), so I&#39;m never calling vtkGlobalJavaHash.DeleteAll();.  In fact you can see in the stack trace the following line<div>
<br></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">vtk.vtkGlobalJavaHash.GC()I+73</span></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">so I&#39;m definitely not calling DeleteAll().  For threads, I was under the impression that vtkGlobalJavaHash.GC() should always be called from the EDT if I have any objects that are used for rendering (which I have a bunch of).  I spent a lot of time making this program work in a multithreaded environment.  I separated all calls to any rendering objects and do them in the EDT.  VTK calls to non-rendering objects I do in other threads sometimes.  Are you saying that if a VTK object is created in a given thread, it must also be disposed of in that same thread?  I definitely use one thread to create vtkObjects and then other threads access them in a thread safe manner.  I thought this was OK.<br>
</span></font><br><div class="gmail_quote">On Tue, Mar 29, 2011 at 11:41 AM, Sebastien Jourdain <span dir="ltr">&lt;<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Do you call that method ? This will remove all the VTK object that<br>
have been created through Java regardless if you are still using them<br>
or not.<br>
<br>
&gt; vtkGlobalJavaHash.DeleteAll();<br>
<br>
Have you got an idea in which thread you are using the VTK objects ?<br>
If not, you do have a problem. VTK is not thread safe therefore you<br>
should make sure (like swing) that any VTK code get executed in the<br>
EDT. (creation, setting, update...)<br>
<br>
Seb<br>
<br>
PS: On the other hand, if you know what you are doing, you can use VTK<br>
in a multi-threaded environment with sometime some synchronization<br>
with the EDT.<br>
<div><div></div><div class="h5"><br>
On Tue, Mar 29, 2011 at 2:26 PM, Jonathan Morra &lt;<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>&gt; wrote:<br>
&gt; OK, I&#39;m still getting a lot of JNI errors when I run the vtkGarbageCollector<br>
&gt; that look like the following.  Do you have any idea what&#39;s going on here?<br>
&gt; Here is the code that it is being called from<br>
&gt; private static class MyVTKClean implements Runnable {<br>
&gt;         private boolean runVTKDelete;<br>
&gt;         private int numDelete;<br>
&gt;         public MyVTKClean(boolean runVTKDelete) {<br>
&gt;             this.runVTKDelete = runVTKDelete;<br>
&gt;         }<br>
&gt;         public synchronized void run() {<br>
&gt;             if (runVTKDelete)<br>
&gt;                 numDelete = vtkGlobalJavaHash.DeleteAll();<br>
&gt;             else<br>
&gt;                 numDelete = vtkGlobalJavaHash.GC();<br>
&gt;         }<br>
&gt;         public int getNumDelete() {<br>
&gt;             return numDelete;<br>
&gt;         }<br>
&gt;     }<br>
&gt;<br>
&gt; // I think the VTK clean up has to run<br>
&gt;     // on the EDT, so we&#39;ll do that here<br>
&gt;     public synchronized static void cleanSystem(boolean runVTKDelete) {<br>
&gt;         System.gc();<br>
&gt;         System.runFinalization();<br>
&gt;         MyVTKClean run = new MyVTKClean(runVTKDelete);<br>
&gt;         // I&#39;m not sure what to do here, it crashes sometimes<br>
&gt;         // I honestly think we&#39;re going to have to go through the program<br>
&gt;         // and just manually manage all our own memory.<br>
&gt;         SwingUtilities.invokeLater(run);<br>
&gt;     }<br>
&gt; Here is a reproduction of the JNI VTK error.<br>
&gt; #<br>
&gt; # A fatal error has been detected by the Java Runtime Environment:<br>
&gt; #<br>
&gt; #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000020001ba29400,<br>
&gt; pid=5420, tid=5264<br>
&gt; #<br>
&gt; # JRE version: 6.0_24-b07<br>
&gt; # Java VM: Java HotSpot(TM) 64-Bit Server VM (19.1-b02 mixed mode<br>
&gt; windows-amd64 compressed oops)<br>
&gt; # Problematic frame:<br>
&gt; # C  0x000020001ba29400<br>
&gt; #<br>
&gt; # If you would like to submit a bug report, please visit:<br>
&gt; #   <a href="http://java.sun.com/webapps/bugreport/crash.jsp" target="_blank">http://java.sun.com/webapps/bugreport/crash.jsp</a><br>
&gt; # The crash happened outside the Java Virtual Machine in native code.<br>
&gt; # See problematic frame for where to report the bug.<br>
&gt; #<br>
&gt; ---------------  T H R E A D  ---------------<br>
&gt; Current thread (0x0000000007e4c000):  JavaThread &quot;AWT-EventQueue-0&quot;<br>
&gt; [_thread_in_native, id=5264, stack(0x0000000008ee0000,0x0000000008fe0000)]<br>
&gt; siginfo: ExceptionCode=0xc0000005, ExceptionInformation=0x0000000000000008<br>
&gt; 0x000020001ba29400<br>
&gt; Registers:<br>
&gt; RAX=0x000007fee9a7ffff, RBX=0x0000000007caf0c8, RCX=0x0000000007c00d90,<br>
&gt; RDX=0x0000000008fde720<br>
&gt; RSP=0x0000000008fde608, RBP=0x0000000007caf0d8, RSI=0x000000005976e7a0,<br>
&gt; RDI=0x0000000007cafff0<br>
&gt; R8=0x0000000000000000, R9=0x0000000000000009, R10=0x0000000006ba18b0,<br>
&gt; R11=0x0000000007cafff0<br>
&gt; R12=0x0000000007caf0d8, R13=0x0000000008fde720, R14=0x0000000007bdd2d0,<br>
&gt; R15=0x0000000000000002<br>
&gt; RIP=0x000020001ba29400, EFLAGS=0x0000000000010246<br>
&gt; Register to memory mapping:<br>
&gt; RAX=0x000007fee9a7ffff<br>
&gt; 0x000007fee9a7ffff is pointing to unknown location<br>
&gt; RBX=0x0000000007caf0c8<br>
&gt; 0x0000000007caf0c8 is pointing to unknown location<br>
&gt; RCX=0x0000000007c00d90<br>
&gt; 0x0000000007c00d90 is pointing to unknown location<br>
&gt; RDX=0x0000000008fde720<br>
&gt; 0x0000000008fde720 is pointing into the stack for thread: 0x0000000007e4c000<br>
&gt; &quot;AWT-EventQueue-0&quot; prio=6 tid=0x0000000007e4c000 nid=0x1490 runnable<br>
&gt; [0x0000000008fde000]<br>
&gt;    java.lang.Thread.State: RUNNABLE<br>
&gt; RSP=0x0000000008fde608<br>
&gt; 0x0000000008fde608 is pointing into the stack for thread: 0x0000000007e4c000<br>
&gt; &quot;AWT-EventQueue-0&quot; prio=6 tid=0x0000000007e4c000 nid=0x1490 runnable<br>
&gt; [0x0000000008fde000]<br>
&gt;    java.lang.Thread.State: RUNNABLE<br>
&gt; RBP=0x0000000007caf0d8<br>
&gt; 0x0000000007caf0d8 is pointing to unknown location<br>
&gt; RSI=0x000000005976e7a0<br>
&gt; 0x000000005976e7a0 is pointing to unknown location<br>
&gt; RDI=0x0000000007cafff0<br>
&gt; 0x0000000007cafff0 is pointing to unknown location<br>
&gt; R8 =0x0000000000000000<br>
&gt; 0x0000000000000000 is pointing to unknown location<br>
&gt; R9 =0x0000000000000009<br>
&gt; 0x0000000000000009 is pointing to unknown location<br>
&gt; R10=0x0000000006ba18b0<br>
&gt; 0x0000000006ba18b0 is pointing to unknown location<br>
&gt; R11=0x0000000007cafff0<br>
&gt; 0x0000000007cafff0 is pointing to unknown location<br>
&gt; R12=0x0000000007caf0d8<br>
&gt; 0x0000000007caf0d8 is pointing to unknown location<br>
&gt; R13=0x0000000008fde720<br>
&gt; 0x0000000008fde720 is pointing into the stack for thread: 0x0000000007e4c000<br>
&gt; &quot;AWT-EventQueue-0&quot; prio=6 tid=0x0000000007e4c000 nid=0x1490 runnable<br>
&gt; [0x0000000008fde000]<br>
&gt;    java.lang.Thread.State: RUNNABLE<br>
&gt; R14=0x0000000007bdd2d0<br>
&gt; 0x0000000007bdd2d0 is pointing to unknown location<br>
&gt; R15=0x0000000000000002<br>
&gt; 0x0000000000000002 is pointing to unknown location<br>
&gt;<br>
&gt; Top of Stack: (sp=0x0000000008fde608)<br>
&gt; 0x0000000008fde608:   000007fee995d99b 0000000007caf0c0<br>
&gt; 0x0000000008fde618:   0000000007caf0c0 000000005976e7a0<br>
&gt; 0x0000000008fde628:   0000000000000000 000000005976e7a0<br>
&gt; 0x0000000008fde638:   0000000007caf0b0 000000005976e7a0<br>
&gt; 0x0000000008fde648:   0000000007caf0b0 0000000000000000<br>
&gt; 0x0000000008fde658:   0000000008fde720 00000000bb8bd928<br>
&gt; 0x0000000008fde668:   0000000000000000 0000000000000000<br>
&gt; 0x0000000008fde678:   000007fee9960ab3 0000000008fde720<br>
&gt; 0x0000000008fde688:   0000000007cafff0 0000000000000000<br>
&gt; 0x0000000008fde698:   0000000000000000 0000000007e4c000<br>
&gt; 0x0000000008fde6a8:   0000000008fde950 00000000bb8bd928<br>
&gt; 0x0000000008fde6b8:   0000000000000000 0000000058511290<br>
&gt; 0x0000000008fde6c8:   000007fee9960e6f 0000000058511290<br>
&gt; 0x0000000008fde6d8:   0000000008fde928 00000000bca11e68<br>
&gt; 0x0000000008fde6e8:   0000000002407f03 00000000c0c06c78<br>
&gt; 0x0000000008fde6f8:   0000000008fde700 000000006df196a0<br>
&gt; Instructions: (pc=0x000020001ba29400)<br>
&gt; 0x000020001ba293f0:<br>
&gt; [error occurred during error reporting (printing registers, top of stack,<br>
&gt; instructions near pc), id 0xc0000005]<br>
&gt; Stack: [0x0000000008ee0000,0x0000000008fe0000],  sp=0x0000000008fde608,<br>
&gt;  free space=1017k<br>
&gt; Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native<br>
&gt; code)<br>
&gt; C  0x000020001ba29400<br>
&gt; Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)<br>
&gt; j  vtk.vtkObjectBase.VTKDeleteReference(J)V+0<br>
&gt; j  vtk.vtkGlobalJavaHash.GC()I+73<br>
&gt; j  prefs.ENV$MyVTKClean.run()V+18<br>
&gt; j  java.awt.event.InvocationEvent.dispatch()V+47<br>
&gt; j<br>
&gt;  java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V+21<br>
&gt; j<br>
&gt;  java.awt.EventQueue.access$000(Ljava/awt/EventQueue;Ljava/awt/AWTEvent;Ljava/lang/Object;)V+3<br>
&gt; j  java.awt.EventQueue$1.run()Ljava/lang/Void;+12<br>
&gt; j  java.awt.EventQueue$1.run()Ljava/lang/Object;+1<br>
&gt; v  ~StubRoutines::call_stub<br>
&gt; j<br>
&gt;  java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+0<br>
&gt; j<br>
&gt;  java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;+28<br>
&gt; j  java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+46<br>
&gt; j  java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z+204<br>
&gt; j<br>
&gt;  java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+30<br>
&gt; j<br>
&gt;  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11<br>
&gt; j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4<br>
&gt; j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3<br>
&gt; j  java.awt.EventDispatchThread.run()V+9<br>
&gt; v  ~StubRoutines::call_stub<br>
&gt; ---------------  P R O C E S S  ---------------<br>
&gt; Java Threads: ( =&gt; current thread )<br>
&gt;   0x0000000009609800 JavaThread &quot;Timer-4&quot; [_thread_in_native, id=5844,<br>
&gt; stack(0x0000000051110000,0x0000000051210000)]<br>
&gt;   0x000000000960c800 JavaThread &quot;SwingWorker-pool-4-thread-1&quot; daemon<br>
&gt; [_thread_blocked, id=6424, stack(0x0000000053a00000,0x0000000053b00000)]<br>
&gt;   0x000000000960b000 JavaThread &quot;pool-1-thread-1&quot; [_thread_blocked, id=3136,<br>
&gt; stack(0x000000000bd50000,0x000000000be50000)]<br>
&gt;   0x0000000009608800 JavaThread &quot;DestroyJavaVM&quot; [_thread_blocked, id=5108,<br>
&gt; stack(0x00000000022e0000,0x00000000023e0000)]<br>
&gt;   0x0000000009608000 JavaThread &quot;TimerQueue&quot; daemon [_thread_blocked,<br>
&gt; id=6340, stack(0x000000000a8f0000,0x000000000a9f0000)]<br>
&gt;   0x0000000007f2c000 JavaThread &quot;Timer-2&quot; [_thread_blocked, id=6600,<br>
&gt; stack(0x00000000090e0000,0x00000000091e0000)]<br>
&gt;   0x0000000007f2b000 JavaThread &quot;Timer-1&quot; [_thread_blocked, id=3288,<br>
&gt; stack(0x0000000008c40000,0x0000000008d40000)]<br>
&gt;   0x00000000061b0000 JavaThread &quot;ssh-connection 1&quot; daemon [_thread_blocked,<br>
&gt; id=6048, stack(0x00000000086f0000,0x00000000087f0000)]<br>
&gt;   0x00000000080d0000 JavaThread &quot;Transport protocol 1&quot; daemon<br>
&gt; [_thread_in_native, id=4200, stack(0x000000000a730000,0x000000000a830000)]<br>
&gt;   0x0000000007e4c800 JavaThread &quot;Timer-0&quot; [_thread_blocked, id=2128,<br>
&gt; stack(0x0000000008fe0000,0x00000000090e0000)]<br>
&gt; =&gt;0x0000000007e4c000 JavaThread &quot;AWT-EventQueue-0&quot; [_thread_in_native,<br>
&gt; id=5264, stack(0x0000000008ee0000,0x0000000008fe0000)]<br>
&gt;   0x000000000625f800 JavaThread &quot;AWT-Windows&quot; daemon [_thread_in_native,<br>
&gt; id=6700, stack(0x00000000085f0000,0x00000000086f0000)]<br>
&gt;   0x000000000625e800 JavaThread &quot;AWT-Shutdown&quot; [_thread_blocked, id=2500,<br>
&gt; stack(0x00000000084f0000,0x00000000085f0000)]<br>
&gt;   0x000000000611b000 JavaThread &quot;Java2D Disposer&quot; daemon [_thread_blocked,<br>
&gt; id=4280, stack(0x00000000083f0000,0x00000000084f0000)]<br>
&gt;   0x00000000060c7800 JavaThread &quot;Low Memory Detector&quot; daemon<br>
&gt; [_thread_blocked, id=4272, stack(0x0000000006980000,0x0000000006a80000)]<br>
&gt;   0x00000000060c7000 JavaThread &quot;CompilerThread1&quot; daemon [_thread_blocked,<br>
&gt; id=2744, stack(0x0000000006880000,0x0000000006980000)]<br>
&gt;   0x00000000060c3000 JavaThread &quot;CompilerThread0&quot; daemon [_thread_blocked,<br>
&gt; id=5308, stack(0x0000000006780000,0x0000000006880000)]<br>
&gt;   0x00000000060ae800 JavaThread &quot;JDWP Command Reader&quot; daemon<br>
&gt; [_thread_in_native, id=5568, stack(0x0000000006680000,0x0000000006780000)]<br>
&gt;   0x00000000060ab000 JavaThread &quot;JDWP Event Helper Thread&quot; daemon<br>
&gt; [_thread_blocked, id=6736, stack(0x0000000006580000,0x0000000006680000)]<br>
&gt;   0x00000000060a5000 JavaThread &quot;JDWP Transport Listener: dt_shmem&quot; daemon<br>
&gt; [_thread_blocked, id=1744, stack(0x0000000006480000,0x0000000006580000)]<br>
&gt;   0x00000000003e6800 JavaThread &quot;Attach Listener&quot; daemon [_thread_blocked,<br>
&gt; id=6416, stack(0x0000000006360000,0x0000000006460000)]<br>
&gt;   0x00000000060a0800 JavaThread &quot;Signal Dispatcher&quot; daemon [_thread_blocked,<br>
&gt; id=6608, stack(0x0000000006260000,0x0000000006360000)]<br>
&gt;   0x00000000003cd800 JavaThread &quot;Finalizer&quot; daemon [_thread_blocked,<br>
&gt; id=5328, stack(0x0000000005f60000,0x0000000006060000)]<br>
&gt;   0x00000000003ca000 JavaThread &quot;Reference Handler&quot; daemon [_thread_blocked,<br>
&gt; id=6568, stack(0x0000000005e60000,0x0000000005f60000)]<br>
&gt; Other Threads:<br>
&gt;   0x00000000003c3800 VMThread [stack: 0x0000000005d60000,0x0000000005e60000]<br>
&gt; [id=6624]<br>
&gt;   0x00000000060cd800 WatcherThread [stack:<br>
&gt; 0x0000000006a80000,0x0000000006b80000] [id=968]<br>
&gt; VM state:not at safepoint (normal execution)<br>
&gt; VM Mutex/Monitor currently owned by a thread: None<br>
&gt; Heap<br>
&gt;  PSYoungGen      total 18944K, used 491K [0x00000000ead60000,<br>
&gt; 0x00000000ec280000, 0x0000000100000000)<br>
&gt;   eden space 16256K, 3% used<br>
&gt; [0x00000000ead60000,0x00000000eaddae10,0x00000000ebd40000)<br>
&gt;   from space 2688K, 0% used<br>
&gt; [0x00000000ebfe0000,0x00000000ebfe0000,0x00000000ec280000)<br>
&gt;   to   space 2688K, 0% used<br>
&gt; [0x00000000ebd40000,0x00000000ebd40000,0x00000000ebfe0000)<br>
&gt;  PSOldGen        total 43392K, used 10564K [0x00000000c0800000,<br>
&gt; 0x00000000c3260000, 0x00000000ead60000)<br>
&gt;   object space 43392K, 24% used<br>
&gt; [0x00000000c0800000,0x00000000c1251378,0x00000000c3260000)<br>
&gt;  PSPermGen       total 23616K, used 23499K [0x00000000bb600000,<br>
&gt; 0x00000000bcd10000, 0x00000000c0800000)<br>
&gt;   object space 23616K, 99% used<br>
&gt; [0x00000000bb600000,0x00000000bccf2d70,0x00000000bcd10000)<br>
&gt; Dynamic libraries:<br>
&gt; 0x0000000000400000 - 0x000000000042e000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\java.exe<br>
&gt; 0x00000000775d0000 - 0x0000000077779000 C:\Windows\SYSTEM32\ntdll.dll<br>
&gt; 0x00000000773b0000 - 0x00000000774cf000 C:\Windows\system32\kernel32.dll<br>
&gt; 0x000007fefcac0000 - 0x000007fefcb2b000 C:\Windows\system32\KERNELBASE.dll<br>
&gt; 0x000007fefe6b0000 - 0x000007fefe78b000 C:\Windows\system32\ADVAPI32.dll<br>
&gt; 0x000007fefce70000 - 0x000007fefcf0f000 C:\Windows\system32\msvcrt.dll<br>
&gt; 0x000007fefece0000 - 0x000007fefecff000 C:\Windows\SYSTEM32\sechost.dll<br>
&gt; 0x000007fefe090000 - 0x000007fefe1bd000 C:\Windows\system32\RPCRT4.dll<br>
&gt; 0x000000006d890000 - 0x000000006df94000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\server\jvm.dll<br>
&gt; 0x00000000774d0000 - 0x00000000775ca000 C:\Windows\system32\USER32.dll<br>
&gt; 0x000007fefd290000 - 0x000007fefd2f7000 C:\Windows\system32\GDI32.dll<br>
&gt; 0x000007fefd280000 - 0x000007fefd28e000 C:\Windows\system32\LPK.dll<br>
&gt; 0x000007fefed00000 - 0x000007fefedc9000 C:\Windows\system32\USP10.dll<br>
&gt; 0x000007fef9d90000 - 0x000007fef9dcb000 C:\Windows\system32\WINMM.dll<br>
&gt; 0x000007fefe790000 - 0x000007fefe7be000 C:\Windows\system32\IMM32.DLL<br>
&gt; 0x000007fefe390000 - 0x000007fefe499000 C:\Windows\system32\MSCTF.dll<br>
&gt; 0x000000006d800000 - 0x000000006d80e000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\verify.dll<br>
&gt; 0x000000006d450000 - 0x000000006d477000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\java.dll<br>
&gt; 0x000000006d3b0000 - 0x000000006d3ba000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\hpi.dll<br>
&gt; 0x00000000777a0000 - 0x00000000777a7000 C:\Windows\system32\PSAPI.DLL<br>
&gt; 0x000000006d4c0000 - 0x000000006d4f4000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\jdwp.dll<br>
&gt; 0x000000006d6d0000 - 0x000000006d6d8000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\npt.dll<br>
&gt; 0x000000006d850000 - 0x000000006d862000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\zip.dll<br>
&gt; 0x000000006d300000 - 0x000000006d30a000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\dt_shmem.dll<br>
&gt; 0x000007fef1360000 - 0x000007fef13cb000<br>
&gt; C:\Users\...\dist\64\vtkCommonJava.dll<br>
&gt; 0x000007fee9900000 - 0x000007fee9b6f000 C:\Users\...\dist\64\vtkCommon.dll<br>
&gt; 0x000007fef4bf0000 - 0x000007fef4c32000 C:\Users\...\dist\64\vtksys.dll<br>
&gt; 0x000007fefd1d0000 - 0x000007fefd21d000 C:\Windows\system32\WS2_32.dll<br>
&gt; 0x000007fefcde0000 - 0x000007fefcde8000 C:\Windows\system32\NSI.dll<br>
&gt; 0x0000000072850000 - 0x00000000728ed000<br>
&gt; C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4940_none_08e4299fa83d7e3c\MSVCR90.dll<br>
&gt; 0x0000000074590000 - 0x0000000074663000<br>
&gt; C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4940_none_08e4299fa83d7e3c\MSVCP90.dll<br>
&gt; 0x000007fef0410000 - 0x000007fef0419000 C:\Windows\system32\WSOCK32.dll<br>
&gt; 0x000007feedb20000 - 0x000007feedbbc000<br>
&gt; C:\Users\...\dist\64\vtkFilteringJava.dll<br>
&gt; 0x000007fee95e0000 - 0x000007fee98f2000<br>
&gt; C:\Users\...\dist\64\vtkFiltering.dll<br>
&gt; 0x000007fef9f90000 - 0x000007fef9f9f000<br>
&gt; C:\Users\...\dist\64\vtkGenericFilteringJava.dll<br>
&gt; 0x000007fef1320000 - 0x000007fef1356000<br>
&gt; C:\Users\...\dist\64\vtkGenericFiltering.dll<br>
&gt; 0x000007fee8fe0000 - 0x000007fee95d6000 C:\Users\...\dist\64\vtkGraphics.dll<br>
&gt; 0x000007fef0a60000 - 0x000007fef0a91000 C:\Users\...\dist\64\vtkverdict.dll<br>
&gt; 0x000007feef720000 - 0x000007feef7b2000<br>
&gt; C:\Users\...\dist\64\vtkGraphicsJava.dll<br>
&gt; 0x000007fef1290000 - 0x000007fef12df000<br>
&gt; C:\Users\...\dist\64\vtkHybridJava.dll<br>
&gt; 0x000007fee8d30000 - 0x000007fee8fd1000 C:\Users\...\dist\64\vtkHybrid.dll<br>
&gt; 0x000007fee88d0000 - 0x000007fee8d22000<br>
&gt; C:\Users\...\dist\64\vtkRendering.dll<br>
&gt; 0x000007fefe4a0000 - 0x000007fefe6a3000 C:\Windows\system32\ole32.dll<br>
&gt; 0x000007fefe7c0000 - 0x000007fefe897000 C:\Windows\system32\OLEAUT32.dll<br>
&gt; 0x000007fee8600000 - 0x000007fee88ce000 C:\Users\...\dist\64\vtkImaging.dll<br>
&gt; 0x000007fee8150000 - 0x000007fee85f9000 C:\Users\...\dist\64\vtkIO.dll<br>
&gt; 0x000007fef4bc0000 - 0x000007fef4be3000<br>
&gt; C:\Users\...\dist\64\vtkDICOMParser.dll<br>
&gt; 0x000007feed060000 - 0x000007feed110000 C:\Users\...\dist\64\vtkNetCDF.dll<br>
&gt; 0x000007fef9f70000 - 0x000007fef9f8d000<br>
&gt; C:\Users\...\dist\64\vtkNetCDF_cxx.dll<br>
&gt; 0x000007feed560000 - 0x000007feed5f3000 C:\Users\...\dist\64\vtkmetaio.dll<br>
&gt; 0x000007fef0a40000 - 0x000007fef0a55000 C:\Users\...\dist\64\vtkzlib.dll<br>
&gt; 0x000007fef0a10000 - 0x000007fef0a33000 C:\Users\...\dist\64\vtkpng.dll<br>
&gt; 0x000007feef6b0000 - 0x000007feef6d7000 C:\Users\...\dist\64\vtkjpeg.dll<br>
&gt; 0x000007feee410000 - 0x000007feee461000 C:\Users\...\dist\64\vtktiff.dll<br>
&gt; 0x000007feee3e0000 - 0x000007feee403000 C:\Users\...\dist\64\vtkexpat.dll<br>
&gt; 0x000007fef0580000 - 0x000007fef059f000 C:\Windows\system32\AVIFIL32.dll<br>
&gt; 0x000007fef9d20000 - 0x000007fef9d38000 C:\Windows\system32\MSACM32.dll<br>
&gt; 0x000007feee350000 - 0x000007feee379000 C:\Windows\system32\MSVFW32.dll<br>
&gt; 0x000007fefd300000 - 0x000007fefe088000 C:\Windows\system32\SHELL32.dll<br>
&gt; 0x000007fefcdf0000 - 0x000007fefce61000 C:\Windows\system32\SHLWAPI.dll<br>
&gt; 0x000007fefb4e0000 - 0x000007fefb6d4000<br>
&gt; C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_fa396087175ac9ac\COMCTL32.dll<br>
&gt; 0x000007fef9eb0000 - 0x000007fef9ebf000 C:\Users\...\dist\64\vtkftgl.dll<br>
&gt; 0x000007fee9cc0000 - 0x000007fee9ddd000 C:\Windows\system32\OPENGL32.dll<br>
&gt; 0x000007feedaf0000 - 0x000007feedb1d000 C:\Windows\system32\GLU32.dll<br>
&gt; 0x000007fee9bc0000 - 0x000007fee9cb1000 C:\Windows\system32\DDRAW.dll<br>
&gt; 0x000007fef9420000 - 0x000007fef9428000 C:\Windows\system32\DCIMAN32.dll<br>
&gt; 0x000007fefe8a0000 - 0x000007fefea77000 C:\Windows\system32\SETUPAPI.dll<br>
&gt; 0x000007fefcb30000 - 0x000007fefcb66000 C:\Windows\system32\CFGMGR32.dll<br>
&gt; 0x000007fefcdc0000 - 0x000007fefcdda000 C:\Windows\system32\DEVOBJ.dll<br>
&gt; 0x000007fefaed0000 - 0x000007fefaee8000 C:\Windows\system32\dwmapi.dll<br>
&gt; 0x000007feed4e0000 - 0x000007feed554000 C:\Users\...\dist\64\vtkfreetype.dll<br>
&gt; 0x000007fee7f50000 - 0x000007fee814f000 C:\Windows\system32\d3d9.dll<br>
&gt; 0x000007fefb9d0000 - 0x000007fefb9dc000 C:\Windows\system32\VERSION.dll<br>
&gt; 0x000007fef8870000 - 0x000007fef8877000 C:\Windows\system32\d3d8thk.dll<br>
&gt; 0x000007feedaa0000 - 0x000007feedae5000 C:\Users\...\dist\64\vtkexoIIc.dll<br>
&gt; 0x000007feefc40000 - 0x000007feefc57000 C:\Windows\system32\AVICAP32.dll<br>
&gt; 0x000007feec740000 - 0x000007feec7c1000<br>
&gt; C:\Users\...\dist\64\vtkRenderingJava.dll<br>
&gt; 0x000000006d490000 - 0x000000006d497000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\jawt.dll<br>
&gt; 0x000000006d0a0000 - 0x000000006d263000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\awt.dll<br>
&gt; 0x000007fef8bc0000 - 0x000007fef8c31000 C:\Windows\system32\WINSPOOL.DRV<br>
&gt; 0x000007feed010000 - 0x000007feed05e000 C:\Users\...\dist\64\vtkIOJava.dll<br>
&gt; 0x000007feec6f0000 - 0x000007feec732000<br>
&gt; C:\Users\...\dist\64\vtkImagingJava.dll<br>
&gt; 0x000007feed4b0000 - 0x000007feed4d3000<br>
&gt; C:\Users\...\dist\64\vtkVolumeRenderingJava.dll<br>
&gt; 0x000007fee7ad0000 - 0x000007fee7f48000<br>
&gt; C:\Users\...\dist\64\vtkVolumeRendering.dll<br>
&gt; 0x000007fee7a70000 - 0x000007fee7ac2000<br>
&gt; C:\Users\...\dist\64\vtkWidgetsJava.dll<br>
&gt; 0x000007fee78e0000 - 0x000007fee7a6e000 C:\Users\...\dist\64\vtkWidgets.dll<br>
&gt; 0x000007fee9b90000 - 0x000007fee9bb8000 C:\Users\...\dist\64\vtkgdcmJava.dll<br>
&gt; 0x000007fee7820000 - 0x000007fee78df000 C:\Users\...\dist\64\vtkgdcm.dll<br>
&gt; 0x000007fee7710000 - 0x000007fee781e000 C:\Users\...\dist\64\gdcmMSFF.dll<br>
&gt; 0x000007fee76e0000 - 0x000007fee7710000 C:\Users\...\dist\64\gdcmIOD.dll<br>
&gt; 0x000007fee7660000 - 0x000007fee76d5000 C:\Users\...\dist\64\gdcmDSED.dll<br>
&gt; 0x000007feef470000 - 0x000007feef484000 C:\Users\...\dist\64\gdcmCommon.dll<br>
&gt; 0x000007feec230000 - 0x000007feec246000 C:\Users\...\dist\64\gdcmzlib.dll<br>
&gt; 0x000007fee7630000 - 0x000007fee7653000 C:\Users\...\dist\64\gdcmexpat.dll<br>
&gt; 0x000007fee74d0000 - 0x000007fee762b000 C:\Users\...\dist\64\gdcmDICT.dll<br>
&gt; 0x000007fee74a0000 - 0x000007fee74cb000 C:\Users\...\dist\64\gdcmjpeg8.dll<br>
&gt; 0x000007fee7470000 - 0x000007fee749b000 C:\Users\...\dist\64\gdcmjpeg12.dll<br>
&gt; 0x000007fee7440000 - 0x000007fee746c000 C:\Users\...\dist\64\gdcmjpeg16.dll<br>
&gt; 0x000007fee7410000 - 0x000007fee7437000<br>
&gt; C:\Users\...\dist\64\gdcmopenjpeg.dll<br>
&gt; 0x000007fee73d0000 - 0x000007fee7409000 C:\Users\...\dist\64\gdcmcharls.dll<br>
&gt; 0x000007fefb300000 - 0x000007fefb356000 C:\Windows\system32\uxtheme.dll<br>
&gt; 0x000007fefc940000 - 0x000007fefc94f000 C:\Windows\system32\CRYPTBASE.dll<br>
&gt; 0x000000006d340000 - 0x000000006d3a6000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\fontmanager.dll<br>
&gt; 0x000000006d6a0000 - 0x000000006d6b7000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\net.dll<br>
&gt; 0x000007fefc240000 - 0x000007fefc295000 C:\Windows\system32\mswsock.dll<br>
&gt; 0x000007fefc230000 - 0x000007fefc237000 C:\Windows\System32\wship6.dll<br>
&gt; 0x000000006d6c0000 - 0x000000006d6cb000 C:\Program<br>
&gt; Files\Java\jdk1.6.0_24\jre\bin\nio.dll<br>
&gt; 0x000007fee7360000 - 0x000007fee73cf000 C:\Users\...\dist\64\gdcmjni.dll<br>
&gt; 0x000007fefc2e0000 - 0x000007fefc2f7000 C:\Windows\system32\CRYPTSP.dll<br>
&gt; 0x000007fefbfa0000 - 0x000007fefbfe7000 C:\Windows\system32\rsaenh.dll<br>
&gt; 0x000007fefbd50000 - 0x000007fefbd6e000 C:\Windows\system32\USERENV.dll<br>
&gt; 0x000007fefca10000 - 0x000007fefca1f000 C:\Windows\system32\profapi.dll<br>
&gt; 0x000007fefa4e0000 - 0x000007fefa4f5000 C:\Windows\system32\NLAapi.dll<br>
&gt; 0x000007fef89e0000 - 0x000007fef89f5000 C:\Windows\system32\napinsp.dll<br>
&gt; 0x000007fef89c0000 - 0x000007fef89d9000 C:\Windows\system32\pnrpnsp.dll<br>
&gt; 0x000007fef89b0000 - 0x000007fef89c0000 C:\Windows\system32\wshbth.dll<br>
&gt; 0x000007fefc0c0000 - 0x000007fefc11b000 C:\Windows\system32\DNSAPI.dll<br>
&gt; 0x000007fef89a0000 - 0x000007fef89ab000 C:\Windows\System32\winrnr.dll<br>
&gt; 0x000007fefbc40000 - 0x000007fefbc47000 C:\Windows\System32\wshtcpip.dll<br>
&gt; 0x000007fef9f30000 - 0x000007fef9f57000 C:\Windows\system32\IPHLPAPI.DLL<br>
&gt; 0x000007fef9f60000 - 0x000007fef9f6b000 C:\Windows\system32\WINNSI.DLL<br>
&gt; 0x000007fef8990000 - 0x000007fef8998000 C:\Windows\system32\rasadhlp.dll<br>
&gt; 0x000007fef9ec0000 - 0x000007fef9f13000 C:\Windows\System32\fwpuclnt.dll<br>
&gt; 0x000007fefcd80000 - 0x000007fefcdba000 C:\Windows\system32\WINTRUST.dll<br>
&gt; 0x000007fefcb70000 - 0x000007fefccd7000 C:\Windows\system32\CRYPT32.dll<br>
&gt; 0x000007fefcab0000 - 0x000007fefcabf000 C:\Windows\system32\MSASN1.dll<br>
&gt; 0x0000000069500000 - 0x000000006a195000 C:\Windows\system32\nvoglv64.DLL<br>
&gt; VM Arguments:<br>
&gt; jvm_args: -Xdebug -Xrunjdwp:transport=dt_shmem,address=javadebug<br>
&gt; -Dfile.encoding=UTF-8 -Dsun.java2d.ddoffscreen=false<br>
&gt; -Dsun.java2d.gdiblit=false<br>
&gt; java_command: Application yes no<br>
&gt; Launcher Type: SUN_STANDARD<br>
&gt; Environment Variables:<br>
&gt; JAVA_HOME=C:\Program Files\Java\jdk1.6.0_18<br>
&gt; PATH=C:\Program Files (x86)\MiKTeX<br>
&gt; 2.8\miktex\bin;C:\Ruby19\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\strawberry\c\bin;C:\strawberry\perl\bin;c:\Program<br>
&gt; Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\MySQL\MySQL<br>
&gt; Server<br>
&gt; 5.1\bin;C:\Users\jmorra\Downloads\dcm4che\dcm4che-2.0.21\bin;C:\Users\...\dist\64;C:\Program<br>
&gt; Files (x86)\Calibre2\;C:\Program Files (x86)\SSH Communications Security\SSH<br>
&gt; Secure Shell<br>
&gt; USERNAME=jmorra<br>
&gt; OS=Windows_NT<br>
&gt; PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 23 Stepping 10, GenuineIntel<br>
&gt;<br>
&gt;<br>
&gt; ---------------  S Y S T E M  ---------------<br>
&gt; OS: Windows 7 Build 7601 Service Pack 1<br>
&gt; CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 23 stepping<br>
&gt; 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1<br>
&gt; Memory: 4k page, physical 4158344k(884196k free), swap 8314844k(3659748k<br>
&gt; free)<br>
&gt; vm_info: Java HotSpot(TM) 64-Bit Server VM (19.1-b02) for windows-amd64 JRE<br>
&gt; (1.6.0_24-b07), built on Feb  2 2011 16:25:45 by &quot;java_re&quot; with MS VC++ 8.0<br>
&gt; (VS2005)<br>
&gt; time: Tue Mar 29 11:21:13 2011<br>
&gt; elapsed time: 50 seconds<br>
&gt;<br>
&gt; On Tue, Mar 29, 2011 at 8:27 AM, Sebastien Jourdain<br>
&gt; &lt;<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; As I said, since a double[] is not a vtkObject, your are good to go<br>
&gt;&gt; with image.GetSpacing(), and there is no arm in that.<br>
&gt;&gt; It is not that it make java difficult to use, it will induce more<br>
&gt;&gt; lines. But don&#39;t make me wrong this problem occurs ONLY when you bind<br>
&gt;&gt; two vtkObject together whithout any Java instance holding the<br>
&gt;&gt; reference in between.<br>
&gt;&gt;<br>
&gt;&gt; BAD =&gt; a.SetX(b.GetY());<br>
&gt;&gt;<br>
&gt;&gt; But you can do<br>
&gt;&gt;<br>
&gt;&gt; z = a.GetX().GetY().GetZ();<br>
&gt;&gt; b.SetZ(z);<br>
&gt;&gt;<br>
&gt;&gt; or that too<br>
&gt;&gt;<br>
&gt;&gt; b.SetZ(z = a.GetX().GetY().GetZ());<br>
&gt;&gt;<br>
&gt;&gt; Seb<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Mar 29, 2011 at 11:10 AM, Jonathan Morra &lt;<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Thanks for your help.  For number 3, image.GetSpacing() is a VTK call,<br>
&gt;&gt; &gt; however it returns a java double[], so I thought that it was OK.  All<br>
&gt;&gt; &gt; these<br>
&gt;&gt; &gt; memory restrictions in Java make it very difficult to use, is there any<br>
&gt;&gt; &gt; plans to improve the usage of VTK in Java?<br>
&gt;&gt; &gt; Thanks again!<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Tue, Mar 29, 2011 at 5:26 AM, Sebastien Jourdain<br>
&gt;&gt; &gt; &lt;<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Hi Jonathan,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I directly reply on the context of your mail,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Tue, Mar 29, 2011 at 2:33 AM, Jonathan Morra &lt;<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt; Since I&#39;m using vtkJavaGarbageCollector I&#39;m already using<br>
&gt;&gt; &gt;&gt; &gt; vtkGlobalJavaHash.GC();.  The main questions that I currently still<br>
&gt;&gt; &gt;&gt; &gt; need<br>
&gt;&gt; &gt;&gt; &gt; answered are here<br>
&gt;&gt; &gt;&gt; &gt; 1.  should I have to call System.gc(); and System.runFinalization();<br>
&gt;&gt; &gt;&gt; &gt; frequently with VTK+Java?  It appears the memory is managed better<br>
&gt;&gt; &gt;&gt; &gt; when<br>
&gt;&gt; &gt;&gt; &gt; calling these lines every time vtkGlobalJavaHash.GC() is called, but<br>
&gt;&gt; &gt;&gt; &gt; I<br>
&gt;&gt; &gt;&gt; &gt; don&#39;t<br>
&gt;&gt; &gt;&gt; &gt; know if this is necessary.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; System.gc(); is the only one that you should really care about. But<br>
&gt;&gt; &gt;&gt; Java does not offer any guarantee if this method will do something or<br>
&gt;&gt; &gt;&gt; not.  Moreover, the GC will stop all the thread to do its job. So it<br>
&gt;&gt; &gt;&gt; is basically up to you.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt; 2.  Is it ok to reuse Java variables?  Such as<br>
&gt;&gt; &gt;&gt; &gt; vtkImageData image = filter.GetOuput();<br>
&gt;&gt; &gt;&gt; &gt; // Do Stuff<br>
&gt;&gt; &gt;&gt; &gt; image = filter2.GetOuput();<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; yes<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt; 3.   Is it OK to move around java objects without an intermediate<br>
&gt;&gt; &gt;&gt; &gt; reference?<br>
&gt;&gt; &gt;&gt; &gt;  Such as<br>
&gt;&gt; &gt;&gt; &gt; image1.SetOutputSpacing(image2.GetSpacing());<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; what do you mean by Java object ? for me as the Set/Get do have a<br>
&gt;&gt; &gt;&gt; capital letter, I would say they come from the VTK world and if they<br>
&gt;&gt; &gt;&gt; return a vtkObject, you should use an intermediate variable otherwise<br>
&gt;&gt; &gt;&gt; if it&#39;s an array of primary type, that is just fine.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt; Sorry, forgot one more.  Should I be calling vtkGlobalJavaHash.GC()<br>
&gt;&gt; &gt;&gt; &gt; from<br>
&gt;&gt; &gt;&gt; &gt; the event dispatch thread?<br>
&gt;&gt; &gt;&gt; &gt; I saw that as an option in vtkJavaGarbageCollector, and I&#39;m not sure<br>
&gt;&gt; &gt;&gt; &gt; why<br>
&gt;&gt; &gt;&gt; &gt; that&#39;s the case.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; This totally depend on your VTK code, if you insure that all the call<br>
&gt;&gt; &gt;&gt; you are doing on the VTK layer is done through the EDT, then you<br>
&gt;&gt; &gt;&gt; should, otherwise you shouldn&#39;t. (This is a requirement if the data is<br>
&gt;&gt; &gt;&gt; shown in a renderer.)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Seb<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>