Correct place for JVM memory settings on Windows

Can someone confirm for me that the correct place to set JVM memory allocation is in service.bat on Windows (Lucee 5)? I’m asking because I am getting some out-of-memory errors, but when I look at the task manager Tomcat is not using anywhere near what I have it set to. In fact, it doesn’t seem to go much over 1GB of memory usage. Wondering if I am missing a setting somewhere else.

If you used the basic Windows installer, look in the tomcat bin directory and there should be a file like tomcat7.exe. It might be called Lucee-- the only local install I have was a stock Tomcat install… Anyway, run that exe and you’ll get a popup something like this:

That is where you set your JVM args and they will be used when the service starts. Don’t ask me where the heck these save to. I’ve never been a big fan of it since I couldn’t automate it easily.

On my machine they’re saved in this registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\Lucee\Parameters\Java

1 Like

Awesome, thanks for answering that. I’ve always wondered where it went. I was afraid it was buried somewhere in the registry. Yuck…

Yes it’s not great.

As a related tip: one thing I normally do is set the JVM path in the Tomcat Service Control applet using an environment variable rather than hard coding it:

%JAVA_HOME%\jre\bin\server\jvm.dll

That means I can update the JDK by just changing the EV and restarting the Lucee/Tomcat service. If you have other JVM services running, e.g. Elasticsearch, they can use the same EV too. No need to edit the config each time.

2 Likes

Thanks everyone. Opening luceew.exe and setting them there did the trick!