Grails表演&内存泄漏问题 -
我们有一个运行在JDK 6.0上的v2.1.1 Grails 3层Web应用程序,可以部署到Jboss 5.1和WebSphere 8.5.5.4环境。 我们目前遇到内存问题,在Seleninum测试运行数小时之后堆空间耗尽。 使用JavaMelody和YourKit工具,我们发现一个大漏洞嫌疑人是'ConcurrentHashMap',但无法将其追溯到我们自己的代码, 并且大多数嫌疑人指向Grails框架库。有提示吗? 如果有人熟悉这个领域,我们正在寻找有偿服务来帮助我们解决这个问题。
我们使用的Grails插件列表。您过去遇到的内存问题中列出的任何插件是否应该避免或替换:
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="GrailsWeb">
<configuration>
<webroots>
<root url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/plugin-config-0.1.5/web-app" relative="/" />
<root url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/json-rest-api-extended-0.2.6/grails-app/views" relative="/" />
<root url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-ui-0.2/web-app" relative="/" />
<root url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-ui-0.2/grails-app/views" relative="/" />
<root url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/mail-1.0.1/grails-app/views" relative="/" />
<root url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/jquery-1.8.0/web-app" relative="/" />
<root url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/famfamfam-1.0.1/web-app" relative="/" />
<root url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/jquery-ui-1.8.15/web-app" relative="/" />
</webroots>
<sourceRoots />
</configuration>
</facet>
<facet type="hibernate" name="Hibernate">
<configuration>
<datasource-map />
<naming-strategy-map />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/db-reverse-engineer-0.5">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/db-reverse-engineer-0.5/src/java" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/db-reverse-engineer-0.5/src/groovy" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/famfamfam-1.0.1">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/famfamfam-1.0.1/grails-app/taglib" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/grails-melody-1.58.0">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/grails-melody-1.58.0/src/groovy" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/hawk-eventing-0.5.1">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/hawk-eventing-0.5.1/src/java" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/hawk-eventing-0.5.1/src/groovy" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/hawk-eventing-0.5.1/grails-app/i18n" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/hibernate-2.1.1">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/hibernate-2.1.1/grails-app/i18n" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/hibernate-hijacker-0.8.1">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/hibernate-hijacker-0.8.1/src/java" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/hibernate-hijacker-0.8.1/src/groovy" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/hibernate-hijacker-0.8.1/grails-app/i18n" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/jquery-1.8.0">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/jquery-1.8.0/src/groovy" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/jquery-1.8.0/grails-app/i18n" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/jquery-1.8.0/grails-app/services" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/jquery-1.8.0/grails-app/taglib" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/jquery-ui-1.8.15">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/jquery-ui-1.8.15/grails-app/i18n" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/jquery-ui-1.8.15/grails-app/taglib" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/json-rest-api-extended-0.2.6">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/json-rest-api-extended-0.2.6/src/groovy" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/json-rest-api-extended-0.2.6/grails-app/controllers" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/json-rest-api-extended-0.2.6/grails-app/domain" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/json-rest-api-extended-0.2.6/grails-app/services" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/jxl-0.54">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/jxl-0.54/src/groovy" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/mail-1.0.1">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/mail-1.0.1/src/groovy" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/mail-1.0.1/grails-app/i18n" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/mail-1.0.1/grails-app/services" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/mail-1.0.1/grails-app/taglib" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/multi-tenant-single-db-0.8.3">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/multi-tenant-single-db-0.8.3/src/java" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/multi-tenant-single-db-0.8.3/src/groovy" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/multi-tenant-single-db-0.8.3/grails-app/services" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/plugin-config-0.1.5">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/plugin-config-0.1.5/src/java" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/plugin-config-0.1.5/src/groovy" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/plugin-config-0.1.5/grails-app/i18n" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/quartz2-2.1.6.2">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/quartz2-2.1.6.2/src/java" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/quartz2-2.1.6.2/src/groovy" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/resources-1.2">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/resources-1.2/src/java" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/resources-1.2/src/groovy" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/resources-1.2/grails-app/i18n" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/resources-1.2/grails-app/taglib" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-mobile-0.5.1" />
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-core-1.2.7.3">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-core-1.2.7.3/src/java" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-core-1.2.7.3/src/groovy" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-core-1.2.7.3/grails-app/i18n" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-core-1.2.7.3/grails-app/services" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-core-1.2.7.3/grails-app/taglib" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-ui-0.2">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-ui-0.2/grails-app/i18n" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-ui-0.2/grails-app/controllers" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-ui-0.2/grails-app/domain" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-ui-0.2/grails-app/services" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/spring-security-ui-0.2/grails-app/taglib" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/svn-1.0.0.M1">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/svn-1.0.0.M1/src/groovy" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/tomcat-2.1.1" />
<content url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/webxml-1.4.1">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/webxml-1.4.1/src/groovy" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="grails-2.1.1" level="application" />
<orderEntry type="module-library" exported="">
<library name="Grails User Library (myApp-grailsPlugins)">
<CLASSES>
<root url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/svn-1.0.0.M1/lib" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.w3c.css/sac/jars/sac-1.3.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/net.sourceforge.cssparser/cssparser/jars/cssparser-0.9.5.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/net.sourceforge.nekohtml/nekohtml/jars/nekohtml-1.9.14.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/xerces/xercesImpl/jars/xercesImpl-2.9.1.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/net.sourceforge.htmlunit/htmlunit-core-js/jars/htmlunit-core-js-2.8.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.apache.james/apache-mime4j/jars/apache-mime4j-0.6.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.apache.httpcomponents/httpmime/jars/httpmime-4.0.1.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/commons-logging/commons-logging/jars/commons-logging-1.1.1.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.apache.httpcomponents/httpcore/jars/httpcore-4.0.1.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.apache.httpcomponents/httpclient/jars/httpclient-4.0.1.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/xalan/xalan/jars/xalan-2.7.1.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/net.sourceforge.htmlunit/htmlunit/jars/htmlunit-2.8.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.seleniumhq.selenium/selenium-common/jars/selenium-common-2.0a7.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.seleniumhq.selenium/selenium-htmlunit-driver/jars/selenium-htmlunit-driver-2.0a7.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/log4j/log4j/jars/log4j-1.2.14.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/net.sourceforge.jexcelapi/jxl/jars/jxl-2.6.12.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.springframework/spring-test/jars/spring-test-3.1.0.RELEASE.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/javax.activation/activation/jars/activation-1.1.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/javax.mail/mail/jars/mail-1.4.3.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.quartz-scheduler/quartz/jars/quartz-2.1.6.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.springframework.mobile/spring-mobile-device/jars/spring-mobile-device-1.1.0.RELEASE.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.hibernate/jtidy/jars/jtidy-r8-20060801.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.hibernate/hibernate-tools/jars/hibernate-tools-3.6.0.CR1.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/freemarker/freemarker/jars/freemarker-2.3.8.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.springframework.security/spring-security-web/jars/spring-security-web-3.0.7.RELEASE.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.springframework.security/spring-security-core/jars/spring-security-core-3.0.7.RELEASE.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/mysql/mysql-connector-java/jars/mysql-connector-java-5.1.20.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/spring-mobile/zips/spring-mobile-0.5.1.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/jxl/zips/jxl-0.54.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/hawk-eventing/zips/hawk-eventing-0.5.1.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/svn/zips/svn-1.0.0.M1.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/hibernate-hijacker/zips/hibernate-hijacker-0.8.1.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/multi-tenant-single-db/zips/multi-tenant-single-db-0.8.3.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/mail/zips/mail-1.0.1.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/spring-security-ui/zips/spring-security-ui-0.2.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/plugin-config/zips/plugin-config-0.1.5.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/quartz2/zips/quartz2-2.1.6.2.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/db-reverse-engineer/zips/db-reverse-engineer-0.5.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/jquery-ui/zips/jquery-ui-1.8.15.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/famfamfam/zips/famfamfam-1.0.1.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/spring-security-core/zips/spring-security-core-1.2.7.3.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/jquery/zips/jquery-1.8.0.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/hibernate/zips/hibernate-2.1.1.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/grails-json-rest-api-extended/zips/grails-json-rest-api-extended-0.2.6.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/tomcat/zips/tomcat-2.1.1.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/resources/zips/resources-1.2.zip!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.grails.plugins/webxml/zips/webxml-1.4.1.zip!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$USER_HOME$/.grails/2.1.1/projects/myApp/plugins/svn-1.0.0.M1/lib" recursive="false" />
</library>
</orderEntry>
</component>
</module>
答案 0 :(得分:0)
java.util.HashMap不是并发的,因此如果您在Grails服务或控制器中使用它,它可能会获得并发更新,这将导致各种问题,其中一个可能导致运行时内存泄漏在服务器上。
尝试使用其中一个并发哈希映射,例如java.util.concurrent.ConcurrentHashMap,看看问题是否消失。