TCPTransportConnection内存泄漏

时间:2018-06-07 08:45:28

标签: java performance memory memory-leaks apache-camel

我正在排除我的应用程序内存泄漏超时。我开始使用我的应用程序并将其保留几天而不发送任何请求。

应用程序很简单,它有一些CFX端点被引发并且Camel路由会监听它们。

当我启动我的应用程序时,堆快速增长并达到最大值约300 Mb。

enter image description here

在几天内,堆平均大小约为500 Mb,最大值约为750 Mb。

以下是分析结果:

enter image description here

我已经查看了堆栈跟踪中重生的物体:

enter image description here

所有这些都会导致TCPTransport.ConnectionHandler或它的联合包类。

使用过的库版本和pom:

Java 8(1.8.0_172)

<properties>
    <fabric8.version>2.3.7.fuse-000036-redhat-2</fabric8.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>fabric8-project-bom-camel-spring-boot</artifactId>
            <version>${fabric8.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>

    <!-- CAMEL dependency -->
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring-boot-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-servlet-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-swagger-java-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-jackson</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-cxf</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-http</artifactId>
    </dependency>

    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-ws-security</artifactId>
    </dependency>
    <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-undertow</artifactId>
    </dependency>
</dependencies>

这是cfx-enpoint配置:

   <cxf:cxfEndpoint address="/{{cxf.version}}/MyService"
       endpointName="a:MyServicePort" id="MyService"
       serviceClass="mypackage.here"
       serviceName="a:MyService"
       wsdlURL="my.wsdl" xmlns:a="http://localhost/v1/MyService">
       <cxf:inInterceptors>
           <ref bean="wssSecurityInterceptor"/>
       </cxf:inInterceptors>
   </cxf:cxfEndpoint>

有没有人有想法,内存泄漏?

1 个答案:

答案 0 :(得分:0)

也遇到同样的问题,恢复为tomcat。切换到G1会有所帮助,但是会在某些GC间隔内降低事务响应时间。

相关问题