zoukankan      html  css  js  c++  java
  • java.lang.OutOfMemoryError: GC overhead limit exceeded

    问题描述:

    Issue of getting below "java.lang.OutOfMemoryError: GC overhead limit exceeded" exception in WebLogic 10.3 and above versions:

    Sep 30, 2010 4:13:27 PM CDT> <Error> <Kernel> <BEA-000802> <ExecuteRequest failed
    java.lang.OutOfMemoryError: GC overhead limit exceeded.
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    at java.util.Arrays.copyOfRange(Arrays.java:3209)
    at java.lang.String.<init>(String.java:216)
    at java.lang.StringBuilder.toString(StringBuilder.java:430)
    at weblogic.servlet.internal.ServletRequestImpl.toString(ServletRequestImpl.java:243)
    at java.lang.String.valueOf(String.java:2827)
    Truncated. see log file for complete stacktrace

    问题分析:

    The "java.lang.OutOfMemoryError: GC overhead limit exceeded" message means that for some reason the garbage collector is taking an excessive amount of time.

    The parallel collector will throw an OutOfMemoryError if too much time is being spent in garbage collection:

    If more than 98% of the total time is spent in garbage collection or less than 2% of the heap is recovered by garbage collection, an OutOfMemoryError will be thrown.

    This feature of throwing  "GC overhead limit exceeded" message is designed to prevent applications from running for an extended period of time while making little or no progress because the heap is too small.

    解决办法:

    You can avoid the above "java.lang.OutOfMemoryError: GC overhead limit exceeded" exception by disabling the GC overhead limit feature (in JDK 6 and 7) by adding the following argument to the start script of JVM:

    -XX:-UseGCOverheadLimit


    Note: Disabling the overhead limit only avoids getting the OutOfMemoryError at an early stage. The OutOfMemoryError is very likely to be thrown at a later stage, because it does not remove the underlying problem. You should still look into your application and JVM settings to find the cause of GC taking an excessively long time.  If you are also getting "java.lang.OutOfMemoryError: Java heap space" errors, then you will want to increase your -Xms and -Xmx settings, for example modifying your start scripts, MEM_ARGS="-Xms1024m -Xmx1024m"

    Reference:

    https://www.oracle.com/technetwork/articles/java/vmoptions-jsp-140102.html

  • 相关阅读:
    (CVE-2020-1938)Apache Tomcat AJP文件包含漏洞复现
    Linux rm 反向删除/排除制定文件(夹)
    Linux下JDK安装及配置 (tar.gz版)
    Linux内核源码分析 -- 同步原语 -- 互斥锁 mutex(未完成)
    Linux内核源码分析 -- 同步原语 -- 自旋锁 spinlock
    Linux内核源码分析 -- 同步原语 -- 信号量 semaphore
    Linux 内核源码分析 -- getuid, geteuid
    Linux 内核源码分析 -- chroot
    手动模拟 Linux 内核 mmu 内存寻址
    glibc-free-_int_free
  • 原文地址:https://www.cnblogs.com/middlewaremagic/p/11929847.html
Copyright © 2011-2022 走看看