• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

garbage collection  RSS feed

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. How can you force garbage collection?
[a] Garbage collection cannot be forced
[b] Call System.gc().
[c] Call Runtime.gc().
[d] Set all references to null.
Answer 1
[a] Garbage collection cannot be forced
i think garbage collection canbe forced by calling System.gc()or Runtime.gc(). m I wrong?
 
Gold Digger
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no it cannot be forced you can just tell the gc you would like it to run but nothing is guaranteed...
Try to search the forum for "force garbage collection" you'll find some good discussion about the subject...
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
Ranch Hand
Posts: 765
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One can request to Sir Garabage Collection could you please run, rather then forcing, Mr.Garabage Collection Run Now!
What do u think Valentin?.
Bye.
Viki.

------------------
Count the flowers of ur garden,NOT the leafs which falls away!
 
Valentin Crettaz
Gold Digger
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not only it is what I think but it is how it is
some useful links:
http://www.javaranch.com/ubb/Forum24/HTML/012281.html
Reference Objects and Garbage Collection
HIH

------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
Vikrama Sanjeeva
Ranch Hand
Posts: 765
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just have done an overview of the article.It seems me good.
Thanx.
Bye.
Viki.
------------------
Count the flowers of ur garden,NOT the leafs which falls away!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!