Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

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!
 
Let nothing stop you! Not even this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic