Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set HeapDumpOnOutOfMemoryError and HeapDumpPath in startup.bat file on Windows XP

Where are the HeapDumpOnOutOfMemoryError and HeapDumpPath params set in the startup.bat file for Tomcat on a Windows PC? I put both params in the file as follows :

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 startup Tomcat > The filename, directory name, or volume label syntax is incorrect.

I'm not sure what part of the statement is incorrect. What am I missing here?

like image 569
katura Avatar asked Jan 10 '11 21:01

katura


People also ask

What is HeapDumpOnOutOfMemoryError?

The -XX:+HeapDumpOnOutOfMemoryError command-line option tells the HotSpot VM to generate a heap dump when an allocation from the Java heap or the permanent generation cannot be satisfied.


1 Answers

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
like image 58
Cat Plus Plus Avatar answered Nov 01 '22 15:11

Cat Plus Plus