0

I had a batch job fail under Tomcat 6.0.26 last night because of an out of memory exception.

Now I'm running the job again now within NetBeans where I have amended the Java VM settings. all appears well.

But can anyone tell me which configuration file in Tomcat I would have to change to allow the Windows service to run with the new settings?

I don't believe that I specify the new VM settings here:

Windows 7 Tomcat service

I realise this may be a duplicate request but thanks anyway. I should add that Tomcat was not installed using the Windows Service Installer exe file described here:

How do I increase memory on Tomcat 7 when running as a Windows Service?

Community
  • 1
  • 1
Mr Morgan
  • 2,215
  • 15
  • 48
  • 78

1 Answers1

1

Probably a good idea to figure out exact cause for the out of memory error.
As most of the time however much increased, it will still go out of memory.
That said,

Uninstall the service.
Install the service with required values.

C:\tomcat-installation\bin> tomcat6 //IS//Tomcat6 ++JvmOptions="-Xms128m;-Xmx768m" --DisplayName="Apache Tomcat 6"

Check http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html for other options.

If service.bat is used for the installation, add required values in the service.bat itself.

"%EXECUTABLE%" //IS//%SERVICE_NAME% ... ++JvmOptions="-Xms128m;-Xmx768m"

Also check https://stackoverflow.com/a/5988466/2208271 which is the actual answer to that particular question, and same can be done in tomcat 6.


When tomcat is started as a standalone process using startup.bat/catalina.bat:

Create (or edit if existing) <tomcat-extracted-dir>\bin\setenv.bat and add an entry similar to following with required values.

set "JAVA_OPTS=-Xms128m -Xmx768m -XX:MaxPermSize=256m %JAVA_OPTS%"

If existing, <tomcat-extracted-dir>\bin\setenv.bat is used by catalina.bat to load additional configuration.

Community
  • 1
  • 1
Sithsu
  • 2,209
  • 2
  • 21
  • 28
  • Thanks Sithsu. I'm running these programs within NetBeans at the moment but want them to run on their own. – Mr Morgan Aug 14 '13 at 17:32