g:link和g:render的Grails和PermGen问题 [英] Grails and PermGen issue with g:link and g:render

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

问题描述

我已经运行grails一段时间了,没有任何问题,但是最近升级到Grails 1.1.1之后,我遇到了可怕的PermGen错误.升级之前,没有此类问题.

I've been running grails for sometime without any issues but recently after an upgrade to Grails 1.1.1, I've encountered the dreaded PermGen errors. Prior to the upgrade, no such issue.

在GSP中使用<g:link><g:render>标记时,似乎发生了错误,尽管我不确定这是否是问题所在,但更多的是,当这些标签正在呈现.

The error seems to be happening when the <g:link> and <g:render> tags are used in a GSP although I'm not sure it's indicative that this is the issue but more of the fact that it ran out of space when these tags were being rendered.

通常,遇到PermGen错误的每个人都建议增加您的Java环境选项-但是问题的根源可能是什么?这是Grails 1.1/冬眠/春季的问题吗?

Typically, everyone who encounters PermGen errors recommend increasing your java environment options -- but what maybe the source of the issue? Is it a Grails 1.1/hibernate/spring problem?

错误:

2010-04-20 05:37:03,962 INFO  [STDOUT] 05:37:03,961 ERROR [GroovyPagesServlet] Error processing GSP: 
Error executing tag <g:render>: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: 
Error executing tag <g:link>: java.lang.OutOfMemoryError: PermGen space 
org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: 
Error executing tag <g:render>: 
org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: 
Error executing tag <g:link>: java.lang.OutOfMemoryError: PermGen space

推荐答案

PermGen的大量空间需求是Grails在开发模式下提供的自动重新编译功能的结果.必须增加PermGen的空间才是即时重新编译所付出的非常非常小的代价.在Grails生产模式中不会出现此问题.之所以需要大型PermGen,是因为Java将类信息存储在称为PermGen的一部分内存中.内存的这一区域与堆和内存的其他部分完全不同. (增加堆空间不会增加PermGen的大小).当Grails重新编译一个类时,它将导致将一个新类添加到PermGen中(而不是替换现有的类信息).当您在开发模式下进行更多更改时,会消耗越来越多的PermGen内存.

Large PermGen space requirements are a result of the automatic recompile feature that Grails offers in development mode. Having to increase PermGen space is a very, very small price to pay for on-the-fly recompiles. This issue does not arise in Grails production mode. The need for large PermGen is because Java stores class info in a portion of memory referred to as PermGen. This area of memory is completely distinct from heap and other portions of memory. (Increasing heap space does not increase PermGen size). When Grails recompiles a class it results in a new class being added to PermGen (rather than the existing class info being replaced). As you make more changes in devel mode, more and more PermGen memory is consumed.

这篇关于g:link和g:render的Grails和PermGen问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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