The JVM places an upper limit on the amount of memory available to the current process in order to prevent runaway processes gobbling system resources and making the machine grind to a halt. When reading or writing large spreadsheets, the JVM may require more memory than has been allocated to the JVM by default - this normally manifests itself as a java.lang.OutOfMemory exception. By default, each workbook allocates 5MB when created and allocates more memory in 5MB increments. These values can be changed by using class WorkbookSettings. Often the OutOfMemory exception can be removed by lowering these values (note that performance may suffer as a result). Alternatively, you can you can allocate more memory to the JVM using the -Xms and -Xmx options; e.g., to allocate an initial heap size of 10 MB, with 100 MB as the upper bound, you should start the JVM like this:
java -Xms10m -Xmx100m MyClass
In order to allocate more memory in this manner to servlets/JSPs, consult the help documentation for the Web Application Server. Oftentimes, as is the case with Tomcat and WebLogic, a simple change to a startup script is all that's necessary.