Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Garbage collection

 
antraarora
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can a programmer code to run the GC whenever you want to?
 
softie
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
GC can be called in the finalise method if you so want to do the garbage collection.
Bye
Venu
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ...
You can call System.gc() or Runtime.gc() any time you want but it does not guarantee garbage collection will occur.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic