Vector & memory fragmentation
- From: "Ike" <rxv@xxxxxxxxxxx>
- Date: Thu, 28 Jul 2005 17:19:00 GMT
If I have a Vevtor:
Vector vector = new Vector();
and I am tracking a particular Object within that Vector, whereby I obtain
it;s original position within the Vector, say, int u. Then say, through
various Vector operations, the location of that particular Object is no
longer at u; Therefore, I periodically want to reset it back to being in
position u within the Vector.
Presently, I do this with :
vector.removeElement(myObject);
vector.insertElementAt(myObject, u);
But I am not so certain this is the "best" way to do this. My concern is
memory fragmentation, or, more generally, the ability for such a procedure
to run for days on end without this developing into a problem somehow.
Given that, is there a better way to accomplish what I am doing here?
Thanks, Ike
.
- Follow-Ups:
- Re: Vector & memory fragmentation
- From: John Currier
- Re: Vector & memory fragmentation
- From: Steve W. Jackson
- Re: Vector & memory fragmentation
- Prev by Date: Re: Logging Strategy/best practice
- Next by Date: Re: XPath on DOMTree
- Previous by thread: Logging Strategy/best practice
- Next by thread: Re: Vector & memory fragmentation
- Index(es):