This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Memory Leak: Deleting the Exception/Throwable Objects which are thrown from elsewhere
- From: abhi123 <ac0030313 at techmahindra dot com>
- To: java at gcc dot gnu dot org
- Date: Mon, 4 Feb 2008 06:09:39 -0800 (PST)
- Subject: Memory Leak: Deleting the Exception/Throwable Objects which are thrown from elsewhere
This is my class
class ExceptionClass
{
public void throwException() throws Exception
{
throw new Exception();
}
}
And I have compiled its .class, .o and .h files
Now in my main I have included it <gcj/cni.h> and <ExceptionClass.h> also
JvCreateJavaVM(NULL);
JvAttachCurrentThread(NULL,NULL); in the begining and
JvDetachCurrentThread(); in the end
Problem here is in I have a while loop which runs indefinitely and goes on
creating
ExceptionClass objects and each invokes above throwException method. And
everytime that method gets invoked a new Exception object is created which
leads to memory leak because I am not able to delete it from main (or could
say deleting doesn't help). How can I stabilize the memory utilization.
Thanks
--
View this message in context: http://www.nabble.com/Memory-Leak%3A-Deleting-the-Exception-Throwable-Objects-which-are-thrown-from-elsewhere-tp15268734p15268734.html
Sent from the gcc - java mailing list archive at Nabble.com.