Java 如何为从 Eclipse 执行的 Tomcat 实例设置 JVM 选项
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23655416/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to set JVM options for Tomcat instance executed from eclipse
提问by NoUserFound
I'm developing a Java/Spring/Hibernate application with eclipse which is deployed to tomcat and I'm having serious java.lang.OutOfMemoryError: GC overhead limit exceeded
issues.
我正在使用 eclipse 开发 Java/Spring/Hibernate 应用程序,该应用程序部署到 tomcat,但我遇到了严重的java.lang.OutOfMemoryError: GC overhead limit exceeded
问题。
I want to try to tweak the JVM settings used by the tomcat instance used by eclipse when launching the application.
我想尝试在启动应用程序时调整 eclipse 使用的 tomcat 实例使用的 JVM 设置。
Do you know how can I set the JVM tomcat parameters from eclipse? +1 if you know which files are affected.
您知道如何从 Eclipse 设置 JVM tomcat 参数吗?+1 如果您知道哪些文件受到影响。
I'm using tomcat 7.0.12, installed from a tar archive on a Linux machine.
我使用的是从 Linux 机器上的 tar 存档安装的 tomcat 7.0.12。
I googled for hours but I couldn't find a working solution, TIA.
我用谷歌搜索了几个小时,但找不到有效的解决方案,TIA。
采纳答案by Dev Blanked
Under the 'server' view you will see the tomcat server instance listed.
在“服务器”视图下,您将看到列出的 tomcat 服务器实例。
Double click on it. This will open up a page in eclipse having server details. There is a link there called 'Open launch configuration'.
双击它。这将在 Eclipse 中打开一个包含服务器详细信息的页面。那里有一个名为“打开启动配置”的链接。
Click on that link and it will give you a dialog window. In that dialog window, under 'arguments' tab under vm arguments you can pass VM args
单击该链接,它将为您提供一个对话窗口。在该对话框窗口中,在 vm arguments 下的“arguments”选项卡下,您可以传递 VM args
回答by NimChimpsky
specify the parameters that are you used by your catalina start up script, found here
指定您的 catalina 启动脚本使用的参数,可在此处找到
tomcat_home/bin
it will use setenv script. Located in catalina_base. You can then add in there :
它将使用 setenv 脚本。位于 catalina_base。然后你可以在那里添加:
export JAVA_OPTS="-server -Xmx768m"
or for windows
或用于窗户
set JAVA_OPTS=-server -Xmx768m