I have single web application running in tomcat 5.0. While generating some report, application is running out of memory. hence throws exception java.lang.OutOfMemoryError: Java heap space I know, this can be solved by increasing JVM memory allocation. But at first place, I want to avoid the exception being seen by the user. Hence I, tried out web.xml enrty for the outOfmemory error, still it shows the exception on the screen.