UseConcMarkSweepGC vs UseParallelGC

前端 未结 4 1433
忘了有多久
忘了有多久 2021-01-31 04:13

I\'m currently having problems with very long garbage collection times. please see the followig. My current setup is that I\'m using a -Xms1g and -Xmx3g. my application is using

4条回答
  •  我在风中等你
    2021-01-31 04:22

    Step 1:

    1. Make sure that you have set enough memory for your application.
    2. Make sure that you don't have memory leaks in your application. Eclipse Memory Analyzer Tool or visualvm will help you to identify leaks in your application.

    Step 2:

    If you don't have any issues with Step 1 with respect to memory leaks, refer to oracle documentation page on use cases for specific garbage collection algorithm in "Java Garbage Collectors" section and gctuning article.

    Since you have decided to configure larger heaps (>= 8 GB), G1GC should work fine for you. Refer to this related SE question on fine tuning key parameters:

    Java 7 (JDK 7) garbage collection and documentation on G1

提交回复
热议问题