File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes Memory Leak !! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Memory Leak !!" Watch "Memory Leak !!" New topic

Memory Leak !!

Isabel Carter

Joined: Sep 26, 2001
Posts: 2
My application has a memory leak which I found using a MemoryMonitor class that came with the JDK demos
I create JComponent subclass instances and add them to a vector.
How I get rid of them is to use
Vector.remove(int index)
But as the memory keeps increasing I want to get rid of these Objects from memory and its not working.
Also what is a circular reference and how do I fix it?
(I Have a suspicion this might be a problem)
Can anyone shed any light on the subject?
What can the package java.lang.ref do for me?
any good sites?
And also what is Load Balancing?
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
ok. first of all i dont think your problem is in the vecotr. it should GC your objects once you remove them IF u dont have any more refrences to them or any containers, listeners binding to them.
circular refrence is when 2 objects when to each other but no one else it pointing to them at all. thus they are alone in the memory pointing to each other, but no one can reach either of them.
this is a problem , but one of no concern to you since the java virtual machine KNOWS to GC cirecular refernces.
as for the rest of your questions here are a few good links:
wood burning stoves
subject: Memory Leak !!
Similar Threads
Memory Leak after repeat deploy and undeploy
What do you mean by memory leak in Java?
Proper way to exit a servlet, and release the resources it is using?
Error in Struts2 application
Memory leak?