The Artima Developer Community
Sponsored Link

Java Answers Forum
Garbage Collection

2 replies on 1 page. Most recent reply: Jul 15, 2003 5:45 AM by M.Murugeswaran

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
M.Murugeswaran

Posts: 7
Nickname: mmuruges
Registered: Jun, 2003

Garbage Collection Posted: Jul 2, 2003 9:35 PM
Reply to this message Reply
Advertisement
Hi,

Whether the objects removed from a vector will be gc'ed?.

I am having a vector which will store application specific alarm records. The vector grows slowly in normal working condition. In some error conditions the the vector will grow very fastly. The condition is that the vector can have maximum of 4000 records. If it reaches beyond the limit then the oldest records to be removed from the vector and to maintain the size to 4000. When I am removing the oldest records they are not reclaimed from the memory by the GC, eventhough I forced the GC. So the memory size continuosly increasing for the process (thru' ps -aux). How to avoid the situation. I will be happy if anybody give solution that will work in java1.1.6


Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Garbage Collection Posted: Jul 3, 2003 11:36 AM
Reply to this message Reply
You can't really "force" garbage collection, you can only "suggest" that it take place.

Is it possible that you have other references to these objects in other places than just the Vector?

If you are doing a lot of removing from the beginning of your list, a LinkedList might be a better choice than a Vector.

M.Murugeswaran

Posts: 7
Nickname: mmuruges
Registered: Jun, 2003

Re: Garbage Collection Posted: Jul 15, 2003 5:45 AM
Reply to this message Reply
Hi,

From the verbosegc I found the GC got invoked when I forced it.
No, other than vector it is nowhere refered.

My Appln. is running in java1.1 so I can't use LinkedList.

Can you please tell me the best opensource profiler for solaris version of java1.2.

Flat View: This topic has 2 replies on 1 page
Topic: Please,help me Previous Topic   Next Topic Topic: Quick BufferedWriter question

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use