Both are same. System.gc()
is effectively equivalent to Runtime.gc()
. System.gc()
internally calls Runtime.gc()
.
The only difference is System.gc()
is a class method where as Runtime.gc()
is an instance method. So, System.gc()
is more convenient.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…