Memory Leaks in Java

Reply

Join Date: Dec 2007
Posts: 1
Reputation: argopal is an unknown quantity at this point 
Solved Threads: 0
argopal argopal is offline Offline
Newbie Poster

Memory Leaks in Java

 
0
  #1
Dec 18th, 2007
How to find memory leaks in java?
And preventive methods advisable?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 489
Reputation: Acidburn is an unknown quantity at this point 
Solved Threads: 5
Acidburn Acidburn is offline Offline
Posting Pro in Training

Re: Memory Leaks in Java

 
0
  #2
Dec 18th, 2007
Its quite hard to make memory leaks in java, having said that I've done it by leaving active connections open.

The try { } catch{} {finally} blocks help in preventing such a case from arrising.

The try block allows the code to throw exceptions - in the exception were plausable any variables that were created within the try should be set to NULL to allow the garbage collector to release the memory back to the JVM.

The finally block allows executes no matter what happend in the try block.

Hope this helps.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,293
Reputation: majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about 
Solved Threads: 67
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Nearly a Posting Virtuoso

Re: Memory Leaks in Java

 
0
  #3
Dec 18th, 2007
As acid burn said, java does not suffer from memory leaks the same as a procedural based language (like C0. The JVM 'disposes' memory leaks as it is shut down.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC