J
Joe
Hi,
I am working on an application that gets large objects from a remote
server and stores them in a Vector for a short period of time. When
the next set of large objects come in the removeAll() method is
called on the Vector object and the next set of large objects are
placed one at a time into the Vector. These large objects stay in the
Vector for a short amount of time (about 5 minutes) before the next
large set comes in.
However, there is a memory leak and I believe it has to do with this
Vector and the objects. I am guessing that for some reason the GC
isn't garbage collecting these large objects after they are removed
from the Vector so I was thinking of using SoftReferences. Now, I
don't know much about SoftReferences but I figure storing Soft-
References would be better than storing the references to the acutal
object.
First, do you think my guess about the GC not collecting unused
references is valid?
Second, would softReferences help reduce these memory leaks?
Third, are there any good tutorials on using Soft/WeakReferences?
Any thoughts or comments would be greatly appreciated.
Thanks,
Joe
I am working on an application that gets large objects from a remote
server and stores them in a Vector for a short period of time. When
the next set of large objects come in the removeAll() method is
called on the Vector object and the next set of large objects are
placed one at a time into the Vector. These large objects stay in the
Vector for a short amount of time (about 5 minutes) before the next
large set comes in.
However, there is a memory leak and I believe it has to do with this
Vector and the objects. I am guessing that for some reason the GC
isn't garbage collecting these large objects after they are removed
from the Vector so I was thinking of using SoftReferences. Now, I
don't know much about SoftReferences but I figure storing Soft-
References would be better than storing the references to the acutal
object.
First, do you think my guess about the GC not collecting unused
references is valid?
Second, would softReferences help reduce these memory leaks?
Third, are there any good tutorials on using Soft/WeakReferences?
Any thoughts or comments would be greatly appreciated.
Thanks,
Joe