Experiencing occasional long garbage collection delays, why?

前端 未结 13 1209
后悔当初
后悔当初 2021-02-04 06:26

I\'m having a hard time dealing with a Java garbage collection problem, and interpreting the logs.

My application requires that no GC takes longer than 2 seconds, and id

13条回答
  •  面向向阳花
    2021-02-04 07:21

    It can be very hard to tell without actually seeing, and in some cases profiling the code.

    Have you implemented finalize() for any of your objects? That will cause a big GC penalty. It would also be interesting to see a test run with a heap of maybe 6 Gigs, if you get a disproportionate improvement in performance it would indicate that the GC is thrashing for memory.

提交回复
热议问题