You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by abhi <il...@rediffmail.com> on 2013/07/02 11:56:53 UTC

java.lang.OutOfMemoryError: PermGen space in Servicemix

Hi,
I am getting *"java.lang.OutOfMemoryError: PermGen space"*  error when I am
deloying my JAR's/bundles in servicemix. 

I am getting this error 3-4 hours after I deploy JAR's in Service Mix.

I have modified my servicemix.sh with larger values, but still getting same
error. 

      if [ "x$JAVA_PERM_MEM" != "x" ]; then
            DEFAULT_JAVA_OPTS="$DEFAULT_JAVA_OPTS -XX:PermSize=*384m*"
        fi
        if [ "x$JAVA_MAX_PERM_MEM" != "x" ]; then
            DEFAULT_JAVA_OPTS="$DEFAULT_JAVA_OPTS -XX:MaxPermSize=*512m*"
        Fi


Can you please guide me on, How can I proceed in finding out root cause?

Note: I am suspecting it might be because of openJPA Jar's that I am usig.
But not Sure about it. 

Thanks,
Abhi



--
View this message in context: http://servicemix.396122.n5.nabble.com/java-lang-OutOfMemoryError-PermGen-space-in-Servicemix-tp5717224.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: java.lang.OutOfMemoryError: PermGen space in Servicemix

Posted by abhi <il...@rediffmail.com>.
Through my application, I am trying to persist data into MSSQL daabase

I am using 
ServieMix  version  = apache-servicemix-4.5.1
JDK version = jdk1.6.0_32


I am using following JAR's

camel-core-2.10.4.jar             jackson-mapper-asl-1.9.10.jar                               
camel-http-2.10.4.jar             openjpa-2.2.0.jar                                           
camel-jackson-2.10.4.jar        
org.apache.servicemix.bundles.ant-1.7.0_6.jar               
camel-jpa-2.10.4.jar             
org.apache.servicemix.bundles.commons-dbcp-1.4_3.jar        
camel-paxlogging-2.10.4.jar     
org.apache.servicemix.bundles.commons-httpclient-3.1_7.jar  
commons-codec-1.6.jar           
org.apache.servicemix.bundles.serp-1.13.1_4.jar             
cxf-api-2.7.3.jar                                                                   
geronimo-jpa_2.0_spec-1.1.jar      spring-jdbc-3.0.7.RELEASE.jar                
sqljdbc4-3.0.jar




--
View this message in context: http://servicemix.396122.n5.nabble.com/java-lang-OutOfMemoryError-PermGen-space-in-Servicemix-tp5717224p5717227.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: java.lang.OutOfMemoryError: PermGen space in Servicemix

Posted by abhi <il...@rediffmail.com>.
I am no more getting *java.lang.OutOfMemoryError: PermGen space*  issue, as I
have increased perm gen size to 512 MB.
But now I am facing strange problem in servicemix.  After I start servicemix
it automatically gets closed after 1-2 hours. Logs doesn't give much
pointers . I have enabled DEBUG logs, Please find below last few lines of
logs that I have recieved


11:13:20,121 | DEBUG | 5)-10.10.10.10 | tcp                              | 
-  -  | RMI TCP Connection(25)-10.10.10.10: (port 51130) op = 80
11:13:20,121 | DEBUG | 5)-10.10.10.10 | loader                           | 
-  -  | RMI TCP Connection(25)-10.10.10.10: name =
"javax.management.ObjectName", codebase = ""
11:13:20,937 | DEBUG | NioProcessor-3   | ServerSession                    |
26 - org.apache.sshd.core - 0.8.0 | Received packet SSH_MSG_CHANNEL_CLOSE
11:13:20,937 | DEBUG | NioProcessor-3   | ChannelSession                   |
26 - org.apache.sshd.core - 0.8.0 | Received SSH_MSG_CHANNEL_CLOSE on
channel 0
11:13:20,937 | DEBUG | NioProcessor-3   | ChannelSession                   |
26 - org.apache.sshd.core - 0.8.0 | Send SSH_MSG_CHANNEL_CLOSE on channel 0
11:13:20,946 | DEBUG | NioProcessor-3   | ServerSession                    |
26 - org.apache.sshd.core - 0.8.0 | Closing session
11:13:20,946 | DEBUG | NioProcessor-3   | ServerSession                    |
26 - org.apache.sshd.core - 0.8.0 | Closing IoSession
11:13:20,946 | DEBUG | NioProcessor-3   | ServerSession                    |
26 - org.apache.sshd.core - 0.8.0 | IoSession closed
11:13:20,946 | INFO  | NioProcessor-3   | ServerSession                    |
26 - org.apache.sshd.core - 0.8.0 | Session smx@/127.0.0.1:38193 closed
11:13:21,095 | DEBUG | 5)-10.10.10.10 | tcp                              | 
-  -  | RMI TCP Connection(25)-10.10.10.10: (port 51130) op = 82
11:13:21,124 | DEBUG | 5)-10.10.10.10 | tcp                              | 
-  -  | RMI TCP Connection(25)-10.10.10.10: (port 51130) op = 80
11:13:21,124 | DEBUG | 5)-10.10.10.10 | loader                           | 
-  -  | RMI TCP Connection(25)-10.10.10.10: name =
"javax.management.ObjectName", codebase = ""
11:13:21,125 | DEBUG | 5)-10.10.10.10 | tcp                              | 
-  -  | RMI TCP Connection(25)-10.10.10.10: (port 51130) op = 80
11:13:21,125 | DEBUG | 5)-10.10.10.10 | loader                           | 
-  -  | RMI TCP Connection(25)-10.10.10.10: name =
"javax.management.ObjectName", codebase = ""
11:13:21,423 | DEBUG | Thread-35        | AbstractLifeCycle                |
137 - org.eclipse.jetty.util - 7.5.4.v20111024 | stopping
org.eclipse.jetty.jmx.MBeanContainer@3b815cce#STARTED



I have also checked Perm Gen space and heap space through Visual VM.
I have allocated 512 MB space for perm gen and out of which only 72 MB was
used when servicemix crashed. Similarly continuously 104MB to 303 MB was
used out of 512 MB of Heap size. But there is lot of variation in heap size
used. Please find attached screenshots of VisualVM.
<http://servicemix.396122.n5.nabble.com/file/n5717288/VisualVM1.jpeg> 
<http://servicemix.396122.n5.nabble.com/file/n5717288/VisualVM2.jpeg> 

Sometimes I have also observed that Servicemix Client didn't open although
servicemix process is running.

Can anybody let me know how should I solve this issue?


Regards,
ABhi



--
View this message in context: http://servicemix.396122.n5.nabble.com/java-lang-OutOfMemoryError-PermGen-space-in-Servicemix-tp5717224p5717288.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: java.lang.OutOfMemoryError: PermGen space in Servicemix

Posted by abhi <il...@rediffmail.com>.
Hi Wim,
Thanks for your response and valuable suggestions. I am currently using Java
visual VM and following steps you have mentioned. But still not able to get
root class which is causing java.lang.OutOfMemoryError: PermGen space. I
will keep trying and will let you know if I require any help.

BTW following are some error message when I get OutOfMemoryError

1) Exception in thread "ActiveMQ Journal Checkpoint Worker"
java.lang.OutOfMemoryError: PermGen space
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
        at java.lang.Class.getConstructor0(Class.java:2699)
        at java.lang.Class.newInstance0(Class.java:326)
        at java.lang.Class.newInstance(Class.java:308)
        at
sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:381)

2) Exception in thread "SpringOsgiExtenderThread-4"
java.lang.OutOfMemoryError: PermGen space

3) Exception in thread "RMI RenewClean-[10.77.121.189:44444]"
java.lang.OutOfMemoryError: PermGen space

4) Exception in thread "fileinstall-/opt/apache-servicemix-4.5.1/deploy"
java.lang.OutOfMemoryError: PermGen space
Exception in thread "qtp1090421528-194" java.lang.OutOfMemoryError: PermGen
space


Thanks,
Abhi





--
View this message in context: http://servicemix.396122.n5.nabble.com/java-lang-OutOfMemoryError-PermGen-space-in-Servicemix-tp5717224p5717263.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: java.lang.OutOfMemoryError: PermGen space in Servicemix

Posted by Wim Verreydt <wi...@anova.be>.
Hi Abhi,

I guess you have a PermGen memory leak. It's not easy to solve but you can try the following to analyze the problem:

- Open java visual VM (you can find it in ${JAVA_HOME}/bin/jvisualvm)
- Select your process and observe your growing PermGen size in the monitor tab.
- When the PermGen reaches a more than reasonable size, perform a heap dump.
- In the newly created heap dump tab you can find the amount of space each class takes in the Classes section.
- Fur further analysis you van go to the OQL console section. There are some predefines saved queries for PermGen Analysis.

You can use this to find out what is filling up your heap and get a great hint on where the problem is.

Do not hesitate to leave a message if you need more help.

Wim





On 02 Jul 2013, at 11:56, abhi <il...@rediffmail.com> wrote:

> Hi,
> I am getting *"java.lang.OutOfMemoryError: PermGen space"*  error when I am
> deloying my JAR's/bundles in servicemix. 
> 
> I am getting this error 3-4 hours after I deploy JAR's in Service Mix.
> 
> I have modified my servicemix.sh with larger values, but still getting same
> error. 
> 
>      if [ "x$JAVA_PERM_MEM" != "x" ]; then
>            DEFAULT_JAVA_OPTS="$DEFAULT_JAVA_OPTS -XX:PermSize=*384m*"
>        fi
>        if [ "x$JAVA_MAX_PERM_MEM" != "x" ]; then
>            DEFAULT_JAVA_OPTS="$DEFAULT_JAVA_OPTS -XX:MaxPermSize=*512m*"
>        Fi
> 
> 
> Can you please guide me on, How can I proceed in finding out root cause?
> 
> Note: I am suspecting it might be because of openJPA Jar's that I am usig.
> But not Sure about it. 
> 
> Thanks,
> Abhi
> 
> 
> 
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/java-lang-OutOfMemoryError-PermGen-space-in-Servicemix-tp5717224.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.