Java Heap Space Issues And Windows 32 / 64 bit
In another blog post, I wrote about Java Heap Space OutOfMemoryError and how to resolve it. Then I came to the conclusion that allocating more memory to Java in Apache Tomcat would resolve the issue. It did - but only for a while.
It turns out if you run the 32 bit version of Apache Tomcat on Windows, you can only assign 1.3 GB of memory to it. In some cases it's enough, in other cases, it's not.
This is where you should really know the server Tomcat is installed on. If it's a 64 bit machine, you're probably safe. Because if you have a 64 bit machine, you'll be able to allocate more memory to Java in Tomcat.
You just need to install Java 64 bit and Tomcat 64 bit. (I couldn't find Java 64 bit on the Java website so I used FileHippo instead.)
When the 64 bit versions of Java and Tomcat are installed, you'll be able to allocate a lot more memory.
In our specific project where we use Solr (Java based) for search, Tomcat 64 bit in fact used less memory for Java than Tomcat in the 32 bit version. Plus indexing was faster.
Conclusion: if your server runs a 64 bit OS, then you should install the 64 bit Java and Tomcat versions to be able to address Java Heap Space issues.