[英]integration test with cargo-maven2-plugin have memory leak during the stop
Hy everyone, I use the plugin cargo-maven2-plugin to run my integration test on tomcat 8 (waiting the tomcat8-maven-plugin) 大家好,我使用插件cargo-maven2-plugin在tomcat 8上运行集成测试(等待tomcat8-maven-plugin)
Unfortunetly, I've this stack when I stop the container: 不幸的是,当我停止容器时,我有了这个堆栈:
The web application [sportInfo] appears to have started a thread named [transcoder-2-1] but has failed to stop it. Web应用程序[sportInfo]似乎已启动名为[transcoder-2-1]的线程,但未能停止该线程。 This is very likely to create a memory leak. 这很可能造成内存泄漏。 Stack trace of thread: 线程的堆栈跟踪:
And 和
java.lang.ref.WeakReference@606a2c5b}]) but failed to remove it when the web application was stopped. java.lang.ref.WeakReference@606a2c5b}]),但在Web应用程序停止时无法将其删除。 Threads are going to be renewed over time to try and avoid a probable memory leak. 线程将随着时间的流逝而更新,以尝试避免可能的内存泄漏。
The full Stack: 完整的堆栈:
[INFO] [talledLocalContainer] AVERTISSEMENT: The web application [sportInfo] appears to have started a thread named [transcoder-2-1] but has failed to stop it. [INFO] [talledLocalContainer]验证:Web应用程序[sportInfo]似乎已启动名为[transcoder-2-1]的线程,但未能停止该线程。 This is very likely to create a memory leak. 这很可能造成内存泄漏。 Stack trace of thread: [INFO] [talledLocalContainer] sun.misc.Unsafe.park(Native Method) [INFO] [talledLocalContainer] java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) [INFO] [talledLocalContainer] java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) [INFO] [talledLocalContainer] java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403) [INFO] [talledLocalContainer] java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067) [INFO] [talledLocalContainer] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) [INFO] [talledLocalContainer] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [INFO] [talledLocalContainer] java.lang.Thread.run(Thread.java:745) [INFO] [talledLocalContainer] déc. 线程的堆栈跟踪:[INFO] [talledLocalContainer] sun.misc.Unsafe.park(本机方法)[INFO] [talledLocalContainer] java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)[INFO] [ talledLocalContainer] java.util.concurrent.locks.AbstractQueuedSynchronizer $ ConditionObject.await(AbstractQueuedSynchronizer.java:2039)[INFO] [talledLocalContainer] java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)[INFO] [talledLocalContainer] java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)[INFO] [talledLocalContainer] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)[INFO] [talledLocalContainer] java.util.concurrent。 ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)[INFO] [talledLocalContainer] java.lang.Thread.run(Thread.java:745)[INFO] [talledLocalContainer]déc。 01, 2015 6:46:42 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks [INFO] [talledLocalContainer] GRAVE: The web application [sportInfo] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@38ba4aa4]) and a value of type [java.util.Hashtable] (value [{threadId=52, sessionId=6090c68d-a0f2-4df1-954c-10e907c93535, clientApi=-1, hostName=macbook-pro-de-sarah.local, request=DELETE:/sportInfo/private/cache/sportInfo/regions}]) but failed to remove it when the web application was stopped. 2015年1月1日下午6:46:42 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks [INFO] [talledLocalContainer]免费:网络应用[sportInfo]创建了一个ThreadLocal,其键类型为[org.apache.log4j.helpers.ThreadLocalMap ](值[org.apache.log4j.helpers.ThreadLocalMap@38ba4aa4])和类型[java.util.Hashtable]的值(值[{threadId = 52,sessionId = 6090c68d-a0f2-4df1-954c-10e907c93535,clientApi = -1,hostName = macbook-pro-de-sarah.local,请求= DELETE:/ sportInfo / private / cache / sportInfo / regions}]),但在Web应用程序停止时无法将其删除。 Threads are going to be renewed over time to try and avoid a probable memory leak. 线程将随着时间的流逝而更新,以尝试避免可能的内存泄漏。 [INFO] [talledLocalContainer] déc. [INFO] [talledLocalContainer]déc。 01, 2015 6:46:42 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks [INFO] [talledLocalContainer] GRAVE: The web application [sportInfo] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassFactory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@6778ecb0]) and a value of type [java.util.WeakHashMap] (value [{class fr.pmu.siteserver.domain.Type=java.lang.ref.WeakReference@6b3e31a2, class fr.pmu.commons.services.mapping.IntegerListAdapter=java.lang.ref.WeakReference@30fb58d2, class fr.pmu.siteserver.domain.Region=java.lang.ref.WeakReference@5afecb03, class fr.pmu.siteserver.domain.Class=java.lang.ref.WeakReference@7ac3b180, class fr.pmu.siteserver.domain.SSResponse=java.lang.ref.WeakReference@606a2c5b}]) but failed to remove it when the web application was stopped. 2015年1月1日下午6:46:42 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks [INFO] [talledLocalContainer]免费:Web应用程序[sportInfo]创建了一个ThreadLocal,其密钥类型为[com.sun.xml.bind.v2 .ClassFactory $ 1](值[com.sun.xml.bind.v2.ClassFactory$1@6778ecb0])和类型[java.util.WeakHashMap]的值(值[{class fr.pmu.siteserver.domain.Type = java.lang.ref.WeakReference@6b3e31a2,类fr.pmu.commons.services.mapping.IntegerListAdapter=java.lang.ref.WeakReference@30fb58d2,类fr.pmu.siteserver.domain.Region = java.lang.ref。 WeakReference @ 5afecb03,类fr.pmu.siteserver.domain.Class=java.lang.ref.WeakReference@7ac3b180,类fr.pmu.siteserver.domain.SSResponse=java.lang.ref.WeakReference@606a2c5b}]),但失败在Web应用程序停止时将其删除。 Threads are going to be renewed over time to try and avoid a probable memory leak. 线程将随着时间的流逝而更新,以尝试避免可能的内存泄漏。
my plugin config: 我的插件配置:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.9</version>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>run</id>
<configuration>
<configuration>
<properties>
</properties>
</configuration>
</configuration>
<goals>
<goal>run</goal>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<timeout>20000</timeout>
</configuration>
</execution>
</executions>
<configuration>
<container>
<containerId>tomcat8x</containerId>
<zipUrlInstaller>
<url>${tomcat8.url}</url>
</zipUrlInstaller>
<systemProperties>
<tomcat.instance.name>sportInfoIT</tomcat.instance.name>
<java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
</systemProperties>
</container>
<configuration>
<type>standalone</type>
<home>${environment.catalina.home}</home>
<properties>
<cargo.servlet.port>9084</cargo.servlet.port>
<path>/${project.build.finalName}</path>
</properties>
<files>
<file>
<file>${project.build.testOutputDirectory}</file>
<todir>lib</todir>
</file>
</files>
</configuration>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<type>war</type>
<location>${project.build.directory}/${project.artifactId}-${project.version}.war
</location>
<properties>
<context>${project.build.finalName}</context>
</properties>
</deployable>
</deployables>
<deployer>
<type>installed</type>
</deployer>
</configuration>
</plugin>
Can you help me please? 你能帮我吗?
Why you execute start goal twice? 为什么要两次执行起始目标? It is in pre integraton phase and then durign exceution. 它处于积分前阶段,然后处于顽固性排除。 Maybe this is your problem? 也许这是您的问题? I mean that you are running it twice in two threads. 我的意思是您在两个线程中运行了两次。 And why is run execution configuration empty? 为什么运行执行配置为空?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.