Error java.lang.OutOfMemoryError: GC overhead limit exceeded

后端 未结 20 2333
攒了一身酷
攒了一身酷 2020-11-21 05:23

I get this error message as I execute my JUnit tests:

java.lang.OutOfMemoryError: GC overhead limit exceeded

I know what an OutOfMemo

20条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-21 05:29

    If you are sure there are no memory leaks in your program, try to:

    1. Increase the heap size, for example -Xmx1g.
    2. Enable the concurrent low pause collector -XX:+UseConcMarkSweepGC.
    3. Reuse existing objects when possible to save some memory.

    If necessary, the limit check can be disabled by adding the option -XX:-UseGCOverheadLimit to the command line.

提交回复
热议问题