When to Garbage Collect

前端 未结 8 1214
逝去的感伤
逝去的感伤 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:44

    Ensure that the large objects can be gc'ed as early as possible. I.e. set variables to null and/or let them fall out of scope. THis helps!

提交回复
热议问题