Difference between system.gc() and runtime.gc()

前端 未结 7 881
谎友^
谎友^ 2020-12-12 19:15

What is the difference between System.gc() and Runtime.gc()?

7条回答
  •  情话喂你
    2020-12-12 19:50

    From looking at the source code: System.gc() is implemented as

    Runtime.getRuntime().gc();
    

    So it's just a convenience method.

提交回复
热议问题