简体   繁体   English

从Eclipse运行Tomcat时避免Permgen Space错误

[英]Avoid Permgen Space error when running Tomcat from Eclipse

What is the best way to avoid permgen space error when running Tomcat from Eclipse 3.6? 从Eclipse 3.6运行Tomcat时,避免permgen空间错误的最佳方法是什么? Is this done by adding the following line: 这是通过添加以下行来完成的:

-XX:MaxPermSize=512m

at the end of eclipse.ini ? eclipse.ini结尾? Or is there extra configuration necessary? 或者是否需要额外的配置?

The configuration in eclipse.ini is only for the JVM that actually runs Eclipse. eclipse.ini的配置适用于实际运行Eclipse的JVM。

Tomcat is run in its own JVM instance, so you'll need that separately. Tomcat在自己的JVM实例中运行,因此您需要单独使用它。

Assuming you use WTP to start your Tomcat instance, you need to go to your Server configuration, click "Open launch configuration" and there (on the "Arguments" tab) edit/add the VM arguments to include the desired -XX:MaxPermSize argument. 假设您使用WTP启动Tomcat实例,您需要转到服务器配置,单击“打开启动配置”并在那里(在“参数”选项卡上)编辑/添加VM参数以包含所需的-XX:MaxPermSize参数。

No. Tomcat runs in a separate JVM from eclipse. 不,Tomcat在eclipse的独立JVM中运行。 Add this option in the VM arguments of the launch configuration : 在启动配置的VM参数中添加此选项:

  • double-click on the Tomcat server in the Servers view 在Servers视图中双击Tomcat服务器
  • click on the link "Open launch configuration" 点击“打开发射配置”链接
  • switch to the Arguments tab 切换到Arguments选项卡
  • add -XX:MaxPermSize=512m in the VM arguments text area 在VM参数文本区域中添加-XX:MaxPermSize = 512m

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM