• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

garbage collection

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Won't you be my neighbor? - Fred Rogers. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic