By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,461 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a


"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

P: n/a
> "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

P: n/a
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

P: n/a
"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.