Naveen,
Contrary to popular belief you CAN have memory leaks in Java. The garbage collector only collects _unreferenced_ objects, so it's a real possibility that you may have referenced objects that are becoming orphanded. Check out this presention by Ed Lycklama from the KLGroup.
Does Java Have Memory Leaks?
http://www.klgroup.com/jprobe/javaonepres/index.html
Also, If you have JDBC code make sure to _explicity_ close all ResultSets and Statements (CallableStatements and PreparedStatements).
If you don't have a tool such as JProbe to debug your application, you can use the following code to watch your memory usage:
Runtime rt = Runtime.getRuntime();
double freeMem = rt.freeMemory();
double totalMem = rt.totalMemory();
System.out.println("Free memory available in bytes: " + freeMem);
System.out.println("Total memory available in bytes: " + totalMem);
System.out.println("Percentage of memory available: " + freeMem / totalMem);
Best Regards,
Gerry Chike
Java Consultant
-----Original Message-----
From: Naveen Kumar Reddy K [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 24, 2000 9:23 AM
To: [EMAIL PROTECTED]
Subject: OutOfMemory in linux
Hi,
I have a problem ,
i am using jdk1.2 , jsdk2.0, JDBC 2.0, apache web server and Linux OS
for
my project. if i work for some 45 min continously i am getting INTERNAL
SERVER ERROR
i don't know whether its a problem with my servlet or with the JVM used by
linux.
when i see the log file its giving OutOfMemory.
But as far as i know java doesn't have memory leakage.
Please let me know what may be the problem. its urgent
advance thanks,
Naveen
