This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]