Subscribe

Close

Thank you for visiting!

Please consider subscribing to the RSS feed or following me on Twitter.

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.

Comments

I see you are joining the dark side..! ¬_¬

Hi,
Thanks for your blogs.They are really helpful.I am using solr and asp.net.I am finding problem while indexing rich text formats.Can you help me out how to do.
Thanks and regards.

"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."

Thanks for that info ... it's very relevant to the situation we're in.
Can you provide a citation for it? That will help us justify the costs of moving to a 64-bit server.

Lars

To the top