如何在 Windows XP 上的 startup.bat 文件中设置 HeapDumpOnOutOfMemoryError 和 HeapDumpPath
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4651541/
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 HeapDumpOnOutOfMemoryError and HeapDumpPath in startup.bat file on Windows XP
提问by katura
Where are the HeapDumpOnOutOfMemoryErrorand HeapDumpPathparams set in the startup.bat file for Tomcat on a Windows PC? I put both params in the file as follows :
Windows PC 上 Tomcat 的 startup.bat 文件中设置的HeapDumpOnOutOfMemoryError和HeapDumpPath参数在哪里?我将两个参数都放在文件中,如下所示:
set JAVA_OPTS=-Xms100m -Xmx192m
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=c:\jakarta-tomcat\webapps
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
:end
Is that the area where those params should go? I'm getting the following message when I startupTomcat > The filename, directory name, or volume label syntax is incorrect.
那是那些参数应该去的区域吗?我在启动Tomcat时收到以下消息> 文件名、目录名或卷标语法不正确。
I'm not sure what part of the statement is incorrect. What am I missing here?
我不确定声明的哪一部分是不正确的。我在这里缺少什么?
回答by Cat Plus Plus
If you want to split a command into several lines, you have to escape the newlines.
如果你想把一个命令分成几行,你必须对换行符进行转义。
set JAVA_OPTS=-Xms100m -Xmx192m ^
-XX:+HeapDumpOnOutOfMemoryError ^
-XX:HeapDumpPath=c:\jakarta-tomcat\webapps