谁看看这到底是怎么回事,这是控制台的异常片段:
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
Exception in thread "http-apr-8081-exec-4" java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
还有几条,最后都是PermGen space,这是配置struts时的异常。
内存溢出

解决方案 »

  1.   

    网上资料说内存不足,申请内存,或者加大jvm的内存,都试过没有解决。我感觉是struts导入的哪个包有问题,就不知道是哪个?
    这是配置struts时的几个包,导入就有问题
      

  2.   

    PermGen space的全称是Permanent Generation space,是指内存的永久保存区域,这块内存主要是被JVM存放Class和Meta信息的,Class在被Loader时就会被放到PermGen space中,它和存放类实例(Instance)的Heap区域不同,GC(Garbage Collection)不会在主程序运行期对PermGen space进行清理,所以如果你的应用中有很多CLASS的话,就很可能出现PermGen space错误,这种错误常见在web服务器对JSP进行pre compile的时候。如果你的WEB APP下都用了大量的第三方jar, 其大小超过了jvm默认的大小(4M)那么就会产生此错误信息了。
    4.解决方法1: 手动设置MaxPermSize大小,如果是linux系统,修改TOMCAT_HOME/bin/catalina.sh,如果是windows系统,修改TOMCAT_HOME/bin/catalina.bat,
    在“echo "Using CATALINA_BASE: $CATALINA_BASE"”上面加入以下行:
    JAVA_OPTS="-server -XX:PermSize=64M -XX:MaxPermSize=128m
    建议:将相同的第三方jar文件移置到tomcat/shared/lib目录下,这样可以达到减少jar 文档重复占用内存的目的。
    http://www.cnblogs.com/xwdreamer/archive/2011/11/21/2296930.html 
      

  3.   

    2楼+1另一种常见原因就是你滥用 static 变量。
      

  4.   


    你这段文字我不知道看过几遍了,我有更详细的;文章地址:http://blog.csdn.net/lifetragedy/article/details/7708724
    我的class文件可能有点多,再多征求点意见,如果大家一致认为是这个问题,我再去重做一遍
      

  5.   

    这个是个方向;
    但是,我刚才这个异常是运行了http://localhost:8080/struts2-blank-2.0.11/
    也就是struts自带例子的时候出现的问题。里面没有一个是我自己写的
      

  6.   

    应该是jar包 问题  前面几个asm是干嘛的
      

  7.   

    运行之后,异常,然后具体是指向这个文件了
    package java.util.concurrent;
    import java.util.concurrent.locks.*;
    import java.util.concurrent.atomic.*;
    import java.util.*;public class ThreadPoolExecutor extends AbstractExecutorService {
    然后指向下面这段中的这一句           processWorkerExit(w, completedAbruptly);
    final void runWorker(Worker w) {
            Runnable task = w.firstTask;
            w.firstTask = null;
            boolean completedAbruptly = true;
            try {
                while (task != null || (task = getTask()) != null) {
                    w.lock();
                    clearInterruptsForTaskRun();
                    try {
                        beforeExecute(w.thread, task);
                        Throwable thrown = null;
                        try {
                            task.run();
                        } catch (RuntimeException x) {
                            thrown = x; throw x;
                        } catch (Error x) {
                            thrown = x; throw x;
                        } catch (Throwable x) {
                            thrown = x; throw new Error(x);
                        } finally {
                            afterExecute(task, thrown);
                        }
                    } finally {
                        task = null;
                        w.completedTasks++;
                        w.unlock();
                    }
                }
                completedAbruptly = false;
            } finally {
                processWorkerExit(w, completedAbruptly);
            }
        }