miércoles, 22 agosto 2007
java.lang.OutOfMemoryError: PermGen space // More memory for Tomcat under windows
« Updated: Displaying a jTable inside another jTable // JTable cellRenderer | Main | Viewing and storing images from an IP Camera »In many cases, web applications give OutOfMemoryError when their threads require high levels of memory. Image manipulation or intensive database use or calculation can lead to this very common problem.
Normally when you get an OutOfMemory error in a desktop application, you can solve this problem by specifying the java commands -Xms*** (initial Java heap size) and -Xmx*** (maximum Java heap size) when running your program.
To solve this issue in tomcat, you must specify these options in the tomcat startup command / script / batch. In windows tomcat is installed as a service. Tomcat provides a configuration tool to set up these and other parameters. you can find it in (Start->Programs->Apache Tomcat->Configure Tomcat) or by running (.\bin\tomcat5w.exe" //EN//Tomcat5).

Under the "Java" tab you can find two options:
- Initial memory pool: This corresponds to -Xms, you can specify the size in Mb.
- Maximum memory pool: This corresponds to -Xmx, you can specify the size in Mb.
Now you can specify a higher maximum memory so that Tomcat doesn't get the OutOfMemoryError. Remember to take in consideration your hardware capabilities.
Technorati Tags: OutOfMemoryError OutOfMemory Apache Tomcat Apache Tomcat PermGen Space PermGen space -Xms -Xmx allocate memory increase windows wrapper service
Posted by at 3:55 PM in Apache Tomcat
[Trackback URL for this entry]
Cool site.