增加tomcat7 maven插件的内存? [英] Increase memory of tomcat7 maven plugin?

查看:203
本文介绍了增加tomcat7 maven插件的内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用tomcat7-maven-plugin直接从maven启动嵌入式tomcat7实例。这工作正常,但Tomcat启动似乎没有足够的内存。我怀疑我需要设置

  -XX:MaxPermSize = 256m 

但我无法弄明白该怎么做。



文件说应该使用插件配置部分中的systemProperties元素。但是,选项被指定为XML元素,并且需要看起来像这样:

 < configuration> 
< systemProperties>
< XX:MaxPermSize> 256m< / XX:MaxPermSize>
< / systemProperties>
< / configuration>

但这当然不可能,因为它打破了XML(XX被解释为命名空间)。 / p>

当然我可以通过设置环境变量解决这个问题

  MAVEN_OPTS = -XX:MaxPermSize = 256m 

但我更愿意只为嵌入式Tomcat增加它。有什么想法吗?

解决方案

你可以用这种方式设置属性

 < configuration> 
< systemProperties>
< JAVA_OPTS> -Xms256m -Xmx512m -XX:MaxPermSize = 256m< / JAVA_OPTS>
< / systemProperties>
< / configuration>


I want to start an embedded tomcat7 instance directly from maven using the tomcat7-maven-plugin. This is working fine, but the Tomcat started doesn't seem to have enough memory. I suspect that I would need to set

-XX:MaxPermSize=256m

but I can't figure out how to do it.

The documentation says one should use the "systemProperties" element in the "configuration" section of the plugin. However, the options are specified as XML elements and would need to look like that:

<configuration>
  <systemProperties>
    <XX:MaxPermSize>256m</XX:MaxPermSize>
  </systemProperties>
</configuration>

But that's of course not possible as it breaks the XML (XX is interpreted as a namespace).

Of course I could get around this problem by setting environment variable

MAVEN_OPTS=-XX:MaxPermSize=256m

but I would prefer to only increase it for the embedded Tomcat. Any ideas how to do that?

解决方案

You can set the properties in this way

<configuration>
  <systemProperties>
    <JAVA_OPTS>-Xms256m -Xmx512m -XX:MaxPermSize=256m</JAVA_OPTS>
  </systemProperties>
</configuration>

这篇关于增加tomcat7 maven插件的内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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