Grails PermGem错误 [英] Grails PermGem error

查看:132
本文介绍了Grails PermGem错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要这个问题的帮助。

I need help with this problem. I need someone to explain to me why is this happening and how to prevent or avoid it.

Exception in thread "Thread-747" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-748" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-759" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-760" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-764" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-765" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-766" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-767" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-773" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-774" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-780" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-781" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-788" java.lang.OutOfMemoryError: PermGen space
Exception in thread "Thread-789" java.lang.OutOfMemoryError: PermGen space
2011-06-20 14:42:10,668 [http-8080-6] ERROR [/CM].[grails]  - Servlet.service() for servlet grails threw exception
java.lang.OutOfMemoryError: PermGen space
2011-06-20 14:42:10,668 [http-8080-6] ERROR [/CM].[default]  - Servlet.service() for servlet default threw exception
java.lang.OutOfMemoryError: PermGen space
: java.lang.OutOfMemoryError: PermGen space
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
        at _GrailsPackage_groovy$_run_closure8.doCall(_GrailsPackage_groovy:275)
        at _GrailsPackage_groovy$_run_closure8.call(_GrailsPackage_groovy)
        at _GrailsRun_groovy$_run_closure8.doCall(_GrailsRun_groovy:245)
        at RunApp$_run_closure1.doCall(RunApp.groovy:35)
        at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
        at gant.Gant.withBuildListeners(Gant.groovy:427)
        at gant.Gant.this$2$withBuildListeners(Gant.groovy)
        at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
        at gant.Gant.dispatch(Gant.groovy:415)
        at gant.Gant.this$2$dispatch(Gant.groovy)
        at gant.Gant.invokeMethod(Gant.groovy)
        at gant.Gant.executeTargets(Gant.groovy:590)
        at gant.Gant.executeTargets(Gant.groovy:589)
Caused by: java.lang.OutOfMemoryError: PermGen space
--- Nested Exception ---
java.lang.OutOfMemoryError: PermGen space
Error automatically restarting container: java.lang.OutOfMemoryError: PermGen space
Error executing script RunApp: PermGen space
java.lang.OutOfMemoryError: PermGen space
Error executing script RunApp: PermGen space
Application context shutting down...
Application context shutdown.


推荐答案

PermGen是JVM内存的一个区域,用于加载类。

The PermGen is a region of your JVM's memory that is used to load classes.

在应用程序执行时,它会使用越来越多的内存,特别是在调试环境中时,如果大量使用关闭。

As you application executes, it uses more and more of this memory, especially if you are in a debugging environment, of if you make extensive use of closures.

解决这个问题的方法是增加更多!

The way to fix this is to add more of it!

这是通过传递一个或者在启动应用程序时向JVM提供两个参数。

This is done by passing one or two parameters to the JVM when launching your application.

参数为:

The parameters are :

-XX:MaxPermSize=256m
-XX:PermSize=128m

(调整值以满足您的特定需求)

(adjust the values to your specific needs)

PermSize将是PermGen的初始大小,而MaxPermSize将是投掷前的最大大小在你的文章中有一个例外。

The PermSize will be the initial size of the PermGen, and the MaxPermSize will be the maximum size at which it will increase before throwing you an exception like in your post.

默认情况下,它被设置为 64M ,如果你有一个'真正'的应用程序。

By default, it is set to 64M, which is not much if you have a 'real' application.

注意:您的总内存使用量将为:堆大小+ Perm大小

这篇关于Grails PermGem错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆