Clearing Java Objects

조회 수: 19 (최근 30일)
Joseph Burgel
Joseph Burgel 2011년 6월 21일
My code uses Java objects that I created and provide to ML in a .jar file.
After my code terminates, I try to run "clear java" and I get a message back that some of my objects still exist and Java cannot be cleared:
Warning: Objects of Param/TableCellRenderer class exist - not clearing java Warning: Objects of Param/RowHeaderRenderer class exist - not clearing java
How can I clear these objects? The only way that I have found is to restart ML. Not fun when co-developing between ML and Java.
  댓글 수: 3
Joseph Burgel
Joseph Burgel 2011년 6월 27일
Hi Kaustubha,
No, that's not the case. As and experiment, I removed my .jar file from the Java dynamic class path and added it to the static class path by modifying classpath.txt and re-starting Matlab. Guess what...the problem went away. So, this problem lies in the fact that ML is not properly de-referencing java objects on the dynamic classpath. Or, some aspect of my .java code is causing it not to be properly de-referenced when it's on the dynamic classpath. I have other java objects that don't have this problem and work fine on the dynamic path. Can anyone shed some light on why this might be. Thanks.
Kaustubha Govind
Kaustubha Govind 2011년 6월 27일
Interesting problem. You might want to consider contacting Tech Support to see if they've seen this before.

댓글을 달려면 로그인하십시오.

답변 (1개)

Joseph Burgel
Joseph Burgel 2011년 6월 28일
As an experiment, I removed my .jar file from the Java dynamic class path and added it to the static class path by modifying classpath.txt and re-starting Matlab. Guess what...the problem went away. So, this problem lies in the fact that ML is not properly de-referencing java objects on the dynamic classpath. Or, some aspect of my .java code is causing it not to be properly de-referenced when it's on the dynamic classpath. I have other java objects that don't have this problem and work fine on the dynamic path.

카테고리

Help CenterFile Exchange에서 Call Java from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by