0

I want to allocate more heap space to my tomcat JVM running on a Windows machine. Regardless which value I choose or how/where I configure it, the startup.bat refuses to do its job afterwards. It only runs if it's set to "1024m".

I even have changed (test-wise) the amount in "catalina.bat" like this:

set CATALINA_OPTS= -Xmx2048m

(and it runs with set CATALINA_OPTS= -Xmx1024m)

When I call startup.bat a new cmd window appears for a second. The "calling" cmd window doesn't do anything. The tomcat server doesn't even collect any logs.

OddDev
  • 3,644
  • 5
  • 30
  • 53
  • Well, you're missing the `"` double quotes from your line at least. – Kayaman Mar 22 '16 at 13:22
  • @Kayaman This is so confusing... you find ten different syntax approaches. Really hate this mess. Shall I go with 'set "CATALINA_OPTS= -Xmx2048m"' (without '')? – OddDev Mar 22 '16 at 13:30
  • It's not **that** difficult. The quotes go around the value. – Kayaman Mar 22 '16 at 13:31
  • @Kayaman It's not difficult, it's just a mess because you find x resources which state that you don't need them in Windows and you find y resources stating that you need them. – OddDev Mar 22 '16 at 13:32
  • @Kayaman also hold in mind that it runs with 'set CATALINA_OPTS= -Xmx1024m' – OddDev Mar 22 '16 at 13:35
  • Ah, I didn't register that you were using a Windows machine. It's quite straight forward on *NIX. – Kayaman Mar 22 '16 at 13:37
  • @Kayaman My bad... should've made it more clear. Only used the tag >. – OddDev Mar 22 '16 at 13:37
  • Are you running on 64-bit Windows with a 64-bit JVM? For 32-bit the max heap size you can get is substantially less than 2048m, usually around 1500m depending on version and environment. – dave_thompson_085 Mar 22 '16 at 16:20

1 Answers1

1

Instead of startup.bat, try using catalina.bat.

The catalina.bat script takes various optional parameters, once of which is run, which Tomcat starts in the current window.

i.e. type the following:

catalina run

then you should be able to see any error messages.

  • Ha :) Worked - thanks! Got the error message (wasn't able to allocate enough space). I guess I need to force my admins to upgrade my server. – OddDev Mar 22 '16 at 16:11