Remove ArrayList Object from Memory

后端 未结 5 617
北恋
北恋 2021-01-14 13:43

I have a bunch of Objects in an ArrayList, if I call ArrayList.remove(object) Do I need to do anything else to remove the object from memory? I am

5条回答
  •  终归单人心
    2021-01-14 14:02

    if you chew through the heap quick enough, you can nudge the gc along with some jvm args ... we have an app that handles billions of operations a day and have tuned it heavily with the ergonomic gc settings I'd encourage you to play with the adaptive size policy, and the max pause setting primarily. Run the program with a profiler exercising the arraylist as you normally would for a while (several minutes) and see how the ambient state of the various heap generations looks. You may end up having to also tweak the memory allocations to generations.

提交回复
热议问题