Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: David L.   on Feb 24 In Java Category.

  
Question Answered By: Kellie Bishop   on Feb 24

It is good know that you should never relay on calling
garbage collector exprlictily. So you must know that
methods that java provides are requests and not
demands. The virtual machine will do its best to do
what you ask, but there is no guarantee that it will
comply.
Anyway, you can also try caling GC through Runtime
class. For example:

Runtime r = Runtime.getRuntime();
r.gc(); // this is an alternate to System.gc()

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Problem work with System.gc (Explicit garbage collection) Or get search suggestion and latest updates.


Tagged: