<div dir="ltr">Hi Kenji,<div><br></div><div>You can look at what we are doing with the delete() method of vtkPanel (knowing that we leak on Linux instead of crashing). </div><div>But I'm guessing I see 3 possible issue in your code.</div><div><br></div><div>1) You should try to detach your renderWindowPanel instance from the parent JFrame.</div><div>2) Then you should set it to null before calling vtkObject.JAVA_OBJECT_MANAGER.gc(false);</div><div>3) And in any case, you should not call Delete() on it.</div><div><br></div><div>I'm thinking your code may cleanup its memory but not the first time you do it. After 3 times, you only cleared the first allocated memory.</div><div><br></div><div>Hope that helps,</div><div><br></div><div>Seb</div><div><br></div><div>PS: If ever you want to contribute your native library loader, please feel free to do so, I can facilitate the process. ;-)</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 18, 2016 at 2:30 PM, Kenji Tsumura <span dir="ltr"><<a href="mailto:kenji.tsumura@neosoftmedical.com" target="_blank">kenji.tsumura@neosoftmedical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I have a Java application that use vtkPanel. Precisely, I made a class that extends vtkRenderWindowPanel. When an object of the class is no more used, I would like to dispose the object. But I couldn’t dispose it no matter how.  Java VisualVM
 indicates the object is JNI global reference. So  how can I dispose it? I used the Delete method and called vtkObject.JAVA_OBJECT_MANAGER.gc(false), but it didn’t work (it works for other VTK objects). The attached file is a simple test code that demonstrates
 vtkRenderWindowPanel is never disposed.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I have seen similar post in the past, but never be answered in the way I hope. So I decided to post. I would appreciate any advice.</p>
<p class="MsoNormal">Thank you,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Kenji</p>
<p class="MsoNormal"><span style="color:#222222"> </span></p>
<p class="MsoNormal"><span style="color:black">“The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended
 recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete
 the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender.</span><span style="color:#222222"></span></p>
<p class="MsoNormal"> </p>
</div>
Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified
 that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy
 of it from your computer system. If you have any questions concerning this message, please contact the sender.
</div>

<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>