File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes is explicitly calling the garbage collector a god Idea ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "is explicitly calling the garbage collector a god Idea ?" Watch "is explicitly calling the garbage collector a god Idea ?" New topic
Author

is explicitly calling the garbage collector a god Idea ?

Anirban Chatterjee
Greenhorn

Joined: Feb 06, 2001
Posts: 18
Hi ,
One can explicitly invoke the garbage collector by
System.gc() ;
Is this a good programming practice ?
When should one do it or should not do it ?
Thanks
Anirban
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 11862
If you have just completed some complex task and have shown the results to the user, now is a good time to call GC because (presumably) the user is looking at the screen, not issuing new commands.
This is a common practice in games.
Basically - use your highly developed programmer skills and decide for yourself....
Bill
------------------
author of:


Java Resources at www.wbrogden.com
 
 
subject: is explicitly calling the garbage collector a god Idea ?
 
Threads others viewed
Garbage Collection Problem
Garbage collection
JPA Queries Open Cursors
garbage collector
Garbage Collection Problem
IntelliJ Java IDE