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
256 views
in Technique[技术] by (71.8m points)

java - PermGen space error - Glassfish Server

I am running java web application using Hibernate and glassfish Server. I am getting

java.lang.OutOfMemoryError: PermGen space exception when after I deploying it several times.

I tried -XX:MaxPermSize=128M in my Environment variables, but it doesn't work.

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

To solve this problem ( in linux based os ) do following

1) increase memory (so that this problem don't come frequently ) by configuring "domain.xml" in

/glassfish/domain/domain1/config

search for

<jvm-options>-XX:MaxPermSize=

set it to higher value eg- 198m or 256m

2) kill the glassfish process to free the port on which it was running ( in my case it was 8686) open terminal (in linux based os) and type -

sudo netstat -npl | grep 8686

this will result in something like..

tcp6 0 0 :::8686 :::* LISTEN 3452/java

next use

kill -9 3452 to kill that process ( 3452 in this case )

Now try to start glassfish, it should start.


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

...