This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

garbage collector  RSS feed

 
feroz muhamed
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do we can use garbage collector explicitly in our program.if yes please give more details.
 
chi Lin
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use System.gc() to trigger garbage collection.
[ December 31, 2003: Message edited by: chi Lin ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot force garbage collection in Java. You can request that the garbage collector run, using the code in chi's example above, but this does not guarantee that the garbage collector will run.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!