• Post Reply Bookmark Topic Watch Topic
  • New Topic

is explicitly calling the garbage collector a god Idea ?  RSS feed

 
Anirban Chatterjee
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!