I have the same problem. I'm using POI to export some data from an DB. The problem is that our users (stupid users ) want to extract ~ 400.000 rows of data. I have managed to write in xls file only 10.000 rows and in different workbooks. However, at 200.000 rows Tomcat is throwing an "Out of memory " exception . Tomcat instance can have up to 256 M RAM. I don't want to raise Tomcat virtual memory.