Java / Garbage collection
Difference between system.gc() and runtime.gc().
There is no significant difference between System.gc() and Runtime.gc().
System.gc() internally calls Runtime.gc(). The only difference is System.gc() is a class method whereas Runtime.gc() is an instance method.
Runtime.gc() is a native method whereas System.gc() is non - native method which in turn calls the Runtime.gc().
Calling System.gc is more convenient than Runtime.gc as we call class method directly.
More Related questions...