Я устраняю неполадки утечки памяти в моем приложении.Я запускаю свое приложение и оставляю его в покое на пару дней, не отправляя ни одного запроса.
Приложение является простым, оно имеет несколько поднятых CFX-оконечных точек и Camel-маршруты, слушающие их.
Когда я запускаю свое приложение, куча быстро растет и достигает максимума около 300 Мб.
Через пару дней,средний размер кучи - около 500 МБ, максимальный - около 750 МБ.
Вот результат профилирования:
Я посмотрелна трассе стека для тяжелых уцелевших объектов:
Все они ведут к 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>
У кого-нибудь есть идеи,куда подтекает память?