What are the differences between System.gc() and Runtime.gc()?

John Mitchell

The methods are basically equivalent. Both suggest to the JRE that it might be a good idea if the garbage collector actually does some work now.

Specifically, System.gc() is a static method so it's a wee bit more convenient to use rather than having to do e.g., Runtime.getRuntime().gc().

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact