Spring Integration PermGen space

1.3k views Asked by At

I try to get my spring application, that uses spring - integration working.

But unfortunately. once I added spring-integration to my application, I get PermGen Space errors, once I started it.

I am using Spring Version 3.2.3 and Spring integration Verison 2.2.3 on tomcat 7. I already changed the permsize to 512m, this doesn't solve the problem. XX:MaxPermSize=512m

In my spring context, I only try to create a client connection:

<beans>
        <int:gateway id="gw"
            service-interface="com.example.tcpclientserver.SimpleGateway"
            default-request-channel="input"/>

    <int-ip:tcp-connection-factory id="client"
            type="client"
            host="10.10.1.2"
            port="2001"
            single-use="true"
            so-timeout="10000"/>

    <int:channel id="input" />

    <int-ip:tcp-outbound-gateway id="outGateway"
            request-channel="input"
            reply-channel="clientBytes2StringChannel"
            connection-factory="client"
            request-timeout="10000"
            reply-timeout="10000"/>

    <int:transformer id="clientBytes2String"
            input-channel="clientBytes2StringChannel"
            expression="new String(payload)"/>
</beans>  

Any idea what could be wrong?

1

There are 1 answers

0
Eugene Loy On BEST ANSWER

PermGen Space is a part of jvm memory where classes are loaded.

There are couple of reasons why you can get PermGen Space errors. Most common are:

  1. There are really lots of classes to be loaded by your app (this is rather rare case for typical application that runs on Oracle JVM). You can solve this by increasing your PermGen Space (see how to configure your jvm).
  2. There are classloader leaks in your app. In this case you should find and eliminate them. Read this and this article series for some tips on how to solve this.