Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
126 views
in Technique[技术] by (71.8m points)

java - Recurring "PermGen" in Tomcat 6

I keep getting a "PermGen" error on my Tomcat 6 server.

I know what application is causing the problem, but I am not sure why it is doing so. The application is using MySQL 5 and running on JDK 6.

Are there any tools/suggestions to diagnosis or analyze the underlying issue(s) with the specific application?

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The PermGen is used to store class definitions and the interned string pool. Your code could be filling it (if it calls intern needlessly), but more likely is that the default is undersized for your application.

This is because Tomcat will load new classes every time you deploy a WAR -- or, if you are working in a development environment, every time you edit a JSP. Those should eventually get cleaned up, but in an active development environment you can have periods where there are both old and new instances loaded. Or, if you're in a production environment and have a large web-app, you might simply need more space.

To set the permgen size, use -XX:MaxPermSize=SIZE

The following links may be helpful: tuning GC (this is the 1.5 edition), GC FAQ (1.4.2 edition), Hotspot VM options (I believe this is 1.6)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...