Interessting...<div><br></div><div>As no thread concurrency is involved here, I&#39;m kind of wondering why this happening. And without any warranty I would say either a nvidia driver issue (try to update it) or vtk issue (try another version).</div>
<div>Do you know if that version works on Windows and Mac and only fails on Linux ?</div><div><br></div><div>Thanks,</div><div><br></div><div>Seb<br><br><div class="gmail_quote">On Fri, May 6, 2011 at 1:20 AM, Sathish Kumar <span dir="ltr">&lt;<a href="mailto:kingvsk@aol.com">kingvsk@aol.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

  
    
    
  
  <div text="#000000" bgcolor="#ffffff">
    Hi Sebastien,<br>
    <br>
    I tried your code. But the JVM Carsh is done while starting the app.
    (JVM crash occurred While I press the button named &quot;Dicom Multi
    Planner Reconstruction (2D)&quot; in main form).<br>
    <br>
    Here with I attached the java crash report. Any suggestion?<br>
    <br>
    Thanks,<br><font color="#888888">
    Sathish,<br>
    <br></font><div class="im">
    <br>
    On Thursday 05 May 2011 07:03 PM, Sebastien Jourdain wrote:
    </div><div><div></div><div class="h5"><blockquote type="cite">For your linux issue, I really have to try it on my
      linux, but so far I&#39;ve tried your stuff at home on my Mac and as I
      was able to reproduce the leak with the GC, I had no need to go on
      Linux.<br>
      <br>
      <div class="gmail_quote">
        On Thu, May 5, 2011 at 2:04 AM, Sathish Kumar <span dir="ltr">&lt;<a href="mailto:kingvsk@aol.com" target="_blank">kingvsk@aol.com</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
          <div text="#000000" bgcolor="#ffffff"> Hi Sebastien,<br>
            <br>
            Thanks for your suggestions. But that too not solve my
            problem. If possible please send the whole code you
            corrected.<br>
            <br>
            I have one more question that the same code works great in
            windows and Mac. The problem is only with linux. Is there
            any specific reason for that?<br>
            <br>
            --<br>
            <font color="#888888"> Sathish</font>
            <div>
              <div><br>
                <br>
                On Thursday 05 May 2011 02:39 AM, Sebastien Jourdain
                wrote:
                <blockquote type="cite">Hi Sathish,
                  <div><br>
                  </div>
                  <div>after some digging on what was going on with your
                    code, I&#39;ve figured out that the memory leak you were
                    facing while using the VTK garbage collector was
                    mainly due to Java who keep a reference to any
                    graphical components that have been shown at some
                    point.</div>
                  <div><br>
                  </div>
                  <div>And in your case, your graphical frame keep a
                    reference to all your VTK objects (readers, filters,
                    renderers...). And because of that, VTK could never
                    release them.</div>
                  <div><br>
                  </div>
                  <div>In order to solve your specific issue you have to
                    have some code like that in
                    your WindowClosed listener:</div>
                  <div><br>
                  </div>
                  <div>
                    <div>private void
                      formWindowClosed(java.awt.event.WindowEvent evt) {</div>
                    <div>     this.myVtkObjectA = null;</div>
                    <div>     // [...] </div>
                    <div>     this.myVtkObjectZ = null;</div>
                    <div><br>
                    </div>
                    <div>      // but also remove the content of you
                      renderer that will keep</div>
                    <div>     // the whole pipeline alive in the C++
                      layer if not cleared</div>
                    <div>                             </div>
                    <div>     this.myVtkPanel.RemoveAllViewProps();</div>
                    <div>    
                      this.myVtkPanel.GetRenderer().RemoveAllLights();</div>
                    <div>    
this.myVtkPanel.GetRenderWindow().RemoveRenderer(this.myVtkPanel.GetRenderer());</div>
                    <div>}</div>
                  </div>
                  <div><br>
                  </div>
                  <div>As you may see for vtkPanel we have a similar
                    issue where its internal component won&#39;t be
                    released, and for now in order to reduce the memory
                    leak you need to execute the lines that I&#39;ve put
                    above with &quot;myVtkPanel&quot;. </div>
                  <div><br>
                  </div>
                  <div>But in a near future, we will add a Delete()
                    method on the vtkPanel to fully release its internal
                    objects so the code block could be reduced to
                    : this.myVtkPanel.Delete();</div>
                  <div><br>
                  </div>
                  <div>Moreover, Jeff and I are working of documenting
                    the Java part of VTK and providing some tools to
                    help identifying the cause of memory leak in Java as
                    well as improving the concurrency
                    support/management. So if some community member has
                    Java/VTK testing code that produce error/crash
                    because of concurrency or memory leak that could be
                    used as test, please send them to us so we can make
                    sure that the improvement that we are making will
                    solve your issue.</div>
                  <div><br>
                  </div>
                  <div>Thanks,</div>
                  <div><br>
                  </div>
                  <div>Seb</div>
                  <div><br>
                  </div>
                  <div><br>
                    <div class="gmail_quote">On Wed, Apr 27, 2011 at
                      8:30 AM, Sebastien Jourdain <span dir="ltr">&lt;<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>&gt;</span>
                      wrote:<br>
                      <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Hi Sathish,
                        <div><br>
                        </div>
                        <div>Do you think you can share your source code
                          (offlist) so I can give a look and understand
                          why you are facing this issue.</div>
                        <div><br>
                        </div>
                        <div>Thanks,</div>
                        <div><br>
                        </div>
                        <div>Seb</div>
                        <div>
                          <div>
                            <div> <br>
                              <div class="gmail_quote">On Wed, Apr 27,
                                2011 at 2:07 AM, Sathish kumar <span dir="ltr">&lt;<a href="mailto:kingvsk@aol.com" target="_blank">kingvsk@aol.com</a>&gt;</span>
                                wrote:<br>
                                <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"> <font color="black" face="arial" size="2">
                                    <font color="black" face="arial" size="2">
                                      <div> <font face="Arial,
                                          Helvetica, sans-serif">Hi </font><font color="black" face="arial" size="2"><font color="black" face="arial" size="2"><font color="black" face="arial" size="2"><font><font color="black" face="arial" size="2">Sebastien,<br>

                                                </font></font></font></font></font><font color="black" face="arial" size="2"><font color="black" face="arial" size="2"><font color="black" face="arial" size="2"><font color="black" face="arial" size="2"><font color="black" face="arial" size="2"><font><font color="black" face="arial" size="2"><br>

                                                      Thanks for your
                                                      response.<br>
                                                      <br>
                                                    </font></font></font></font></font></font></font><font color="black" face="arial" size="2"><font color="black" face="arial" size="2"><font color="black" face="arial" size="2"><font><font color="black" face="arial" size="2">   
                                                  I developed a simple
                                                  application that loads
                                                  a list of dicom images
                                                  and construct them as
                                                  3D.  It works fine. I
                                                  call VTK from my Java
                                                  Application. If I
                                                  press a button from
                                                  main window, then the
                                                  VTK output will load
                                                  in another Jframe
                                                  window. Once I close
                                                  the output window the
                                                  VTK should release all
                                                  the memory. But i
                                                  doesn&#39;t do that. It
                                                  will be released only
                                                  when I close my main
                                                  application. </font></font></font></font></font><font color="black" face="arial" size="2"><font color="black" face="arial" size="2"><font color="black" face="arial" size="2"><font color="black" face="arial" size="2"><font><font color="black" face="arial" size="2">(Please
                                                    refer the
                                                    attachment).<br>
                                                    <br>
                                                    My Requirement is
                                                    while I close the 3D
                                                    window The VTK
                                                    memory should be
                                                    released. <br>
                                                  </font></font></font></font></font></font>
                                      </div>
                                      <div>
                                        <div> <br>
                                        </div>
                                        <div style="clear:both"><a style="font:lighter 10px Verdana,Arial;color:rgb(0, 0, 0)"><img src="http://presence.mail.aol.com/mailsig/?sn=kingvsk" align="absmiddle" border="0"></a> With
                                          Regards,<br>
                                          <br>
                                          Sathish Kumar V</div>
                                        <br>
                                      </div>
                                    </font></font></blockquote>
                              </div>
                              <br>
                            </div>
                          </div>
                        </div>
                      </blockquote>
                    </div>
                    <br>
                  </div>
                </blockquote>
                <br>
                <br>
              </div>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div><br></div>