When to Garbage Collect

前端 未结 8 1236
逝去的感伤
逝去的感伤 2020-12-11 04:24

I have a piece of code that load a very big image in memory. So it seemed like a reasonable thing to call

System.gc();

before loading the

8条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-11 04:54

    If a memory allocation fails, a GC cycle is initiated and the allocation is tried again.

提交回复
热议问题