How to free up memory?

前端 未结 6 886
鱼传尺愫
鱼传尺愫 2021-02-12 22:17

We have been facing Out of Memory errors in our App server for sometime. We see the used heap size increasing gradually until finally it reaches the available heap in size. This

6条回答
  •  萌比男神i
    2021-02-12 22:35

    I suggest reading Effective Java, chapter 2. Following it, together with a profiler, will help you identify the places where your application produces memory leaks.

    Freeing up memory isn't the way to solve extensive memory consumption. The extensive memory consumption may be a result of two things:

    • not properly written code - the solution is to write it properly, so that it does not consume more than is needed - Effective Java will help here.
    • the application simply needs this much memory. Then you should increase the VM memory using Xmx, Xms, XX:MaxHeapSize,...

提交回复
热议问题