469,299 Members | 2,073 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

How can I only trigger minor garbage collection for my objects?

EKL
What do I have to do to guarantee that the objects that my code creates are
reclaimed by only minor garbage collection runs? In other words, what do I
have to do to only generate garbage for minor gc, and not major gc? Thanks.

-ekl
Jul 17 '05 #1
4 4509


"EKL" <En***********@raytheon.com> wrote in message
news:3c*************@bos-service2.ext.ray.com...
What do I have to do to guarantee that the objects that my code creates are reclaimed by only minor garbage collection runs? In other words, what do I have to do to only generate garbage for minor gc, and not major gc? Thanks.
-ekl


"minor gc", "major gc" ?
Where did you get these terms from ? They seem to be imaginary.

Either way, you can't control the behaviour of the garbage collector.

--
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)
Jul 17 '05 #2
> "minor gc", "major gc" ?
Where did you get these terms from ? They seem to be imaginary.
try reading this page - perhaps IBM is working on imaginary garbage
collection classes :)

http://www-106.ibm.com/developerwork...ry/j-jtp11253/

"Tony Morris" <@dibblegoATbigpond.com@> wrote in message
news:rt*******************@news-server.bigpond.net.au...

"EKL" <En***********@raytheon.com> wrote in message
news:3c*************@bos-service2.ext.ray.com...
What do I have to do to guarantee that the objects that my code creates are
reclaimed by only minor garbage collection runs? In other words, what

do I
have to do to only generate garbage for minor gc, and not major gc?

Thanks.

-ekl


"minor gc", "major gc" ?
Where did you get these terms from ? They seem to be imaginary.

Either way, you can't control the behaviour of the garbage collector.

--
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)

Jul 17 '05 #3
and re-reading this page it says "There is no way to programmatically
triggor a minor collection".........

so, you can call System.gc() to do a major GC, but again, the article says
you should do this sparingly. if at all.....

Jul 17 '05 #4
"chris sennitt" <cs******@nospamblueyonder.co.uk> wrote in message
news:5a*****************@news-binary.blueyonder.co.uk...
and re-reading this page it says "There is no way to programmatically
triggor a minor collection".........

so, you can call System.gc() to do a major GC, but again, the article says
you should do this sparingly. if at all.....


For some reason, I am unable to access that page.
Either way, this is VM dependant behaviour, and vendor-defined terminology
(as opposed to "Java" terminology).

Calling System.gc() does NOT perform a garbage collection - it "suggests" to
run the garbage collector (Java 2 API Specification). Overriding (or
attempting to override) the very complex garbage collection algorithms that
a VM performs is generally a bad idea.

--
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

34 posts views Thread by Ville Voipio | last post: by
2 posts views Thread by C P | last post: by
28 posts views Thread by Goalie_Ca | last post: by
8 posts views Thread by Paul.Lee.1971 | last post: by
56 posts views Thread by Johnny E. Jensen | last post: by
350 posts views Thread by Lloyd Bonafide | last post: by
46 posts views Thread by Carlo Milanesi | last post: by
158 posts views Thread by pushpakulkar | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.