title: Increase memory size of Apache Tomcat Windows Service for a Java application created by an executable file
body: <p>We have a legacy Java web application which we deploy to a Windows Server 2012 machine using an executable file and need to increase its memory pool size, since we get a lot of Out of memory exceptions. </p>
  
  <p>It creates its own folders on Program Files including tomcat bin folder and a Windows service named "Apache Tomcat servicename" which is basically Tomcat version 6 but when I try to edit its Java options through tomcat6w.exe it says that this service is not installed on the system. </p>
  
  <p>Is there a way to change the tomcat service being used by the application to a tomcat service installed from <a href="http://tomcat.apache.org/" rel="nofollow noreferrer">http://tomcat.apache.org/</a></p>
  
  <p>Or maybe edit the service.bat (or any other file?) when creating the executable to hardcode the memory pool size there?</p>
  
  <p>There is a line in service.bat like below: </p>
  
  <pre><code>"%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties" --JvmMs 128 --JvmMx 256
  </code></pre>