can someone tell me the difference between System.gc and Runtime.gc().? -Sanjana
Derek Baker
Ranch Hand
Joined: May 23, 2003
Posts: 46
posted
0
From the API docs:
The call System.gc() is effectively equivalent to the call: Runtime.getRuntime().gc()
And:
The method System.gc() is the conventional and convenient means of invoking this method (Runtime.getRuntime().gc()).
Sumitro Palit
Ranch Hand
Joined: Dec 13, 2003
Posts: 37
posted
0
Sanjana, There is no difference. System.gc calls Runtime.gc Check your installed jdk's source code. You'll find System.java has the gc method as follows: public static void gc() { Runtime.getRuntime().gc(); } -ortimus "Simplicity is virtue"