2017-04-08 6 views
4

저는 Jboss EAP 6.1에 배포 할 EAR 프로젝트가 있습니다. 내 받는다는 빌드의 제품은 다음과 같습니다JBoss EAP 6.1의 Hotswap-agent - java.lang.OutOfMemoryError : PermGen 공간

21:34:55,570 INFO [stdout] (MSC service thread 1-5) HOTSWAP AGENT: 21:34:55.569 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.jbossmodules.JBossModulesPlugin' initialized in ClassLoader 'ModuleClassLoader for Module "deployment.myapp-ds.xml:main" from Service Module Loader'. 
21:35:04,357 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "null" (runtime-name: "myapp-web.war") 
21:35:04,357 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "null" (runtime-name: "myapp-ejb.jar") 
21:35:04,781 INFO [org.jboss.as.jpa] (MSC service thread 1-3) JBAS011401: Read persistence.xml for myproject 
21:35:05,306 INFO [stdout] (MSC service thread 1-7) HOTSWAP AGENT: 21:35:05.306 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.jbossmodules.JBossModulesPlugin' initialized in ClassLoader 'ModuleClassLoader for Module "deployment.myapp-ear.ear:main" from Service Module Loader'. 

21:35:05,488 INFO [stdout] (MSC service thread 1-6) HOTSWAP AGENT: 21:35:05.487 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.hotswapper.HotswapperPlugin' initialized in ClassLoader 'ModuleClassLoader for Module "deployment.myapp-ear.ear.myapp-web.war:main" from Service Module Loader'. 
21:35:05,520 INFO [stdout] (MSC service thread 1-4) HOTSWAP AGENT: 21:35:05.517 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.jbossmodules.JBossModulesPlugin' initialized in ClassLoader 'ModuleClassLoader for Module "deployment.myapp-ear.ear.myapp-ejb.jar:main" from Service Module Loader'. 

이 문제가된다

여기
myapp-ear 
├── myapp-ejb.jar 
├── myapp-web.war 
├── lib 
│ ├── activation.jar 
│ ├── activiti-bpmn-converter.jar 
│ ├── activiti-bpmn-model.jar 
..... 
│ ├── xml-apis.jar 
│ └── xmlbeans.jar 
└── META-INF 
    ├── application.xml 
    ├── hotswap-agent.properties 
    ├── myapp-ds.xml 
    ├── jboss-deployment-structure.xml 
    └── MANIFEST.MF 

이 내 응용 프로그램을 배포 할 때 때 나는 보스 로그에 무엇을 얻을 내 귀를 jboss에 배포 할 때 보통 시간이 10 배 정도 걸리고 브라우저에서 응용 프로그램에 액세스하려고하면 "PermGen 공간 : java.lang.OutOfMemoryError : PermGen space"가 throw됩니다. 내 PermGen 메모리를 700MB로 늘리는 데 지쳤지만 운이 없다. 그래서 hotswap-agent가 너무 많은 메모리를 소비하는 lib 디렉토리에있는 클래스를 포함하여 EAR의 모든 클래스를보고있는 것으로 의심됩니다.

내가보기에 다음으로보아야 할 것은 hotswap-agent.properties에 autoHotswap = false를 배치하여 hotswap을 기본적으로 비활성화하는 것입니다. 위에서 보았 듯이이 파일을 EAR에 넣으려고 시도했지만 EJB와 WAR 클래스 경로는 아무런 차이가 없었습니다.

-javaagent:/workspace/tools/hotswap-agent-1.0.jar=disablePlugin=Deltaspike,disablePlugin=JavaBeans,autoHotswap=false" 

그래서 내 질문은, 어떻게 내 환경에서 핫 스왑 에이전트를 제어 않습니다되어

: I는 또한 같은 JVM_OPTS에 추가, 아무 소용이 시도? 또한 지정된 패키지 (예 : "com.foobar")의 클래스 만보기위한 방법이 있습니까? 마지막으로 jboss에서 ear 배포를 위해 hotswap-agent를 구성하는 올바른 방법은 무엇입니까?

답변

3

hotswap-agent forumVladimir의 도움으로 마지막으로 hotswap-agent가 작동했습니다. 이 그가이 폭주 PermGen 메모리 해결 도움이 상기 : 나는 단지에서 불필요한 플러그인 내가 적절한 시간과 PermGen 메모리 내의 제이 보스를 시작할 수를 제거하면

JBossAS has single classLoader for each module like jar, war etc. On that account there can be a lot of module classloaders in the running JbossAS. Alongside HotswapAgent copies it's classes to each of that module classloaders (it is necessary otherwise HotswapAgent doesn't work inside module classloader). Hence the same HotswapAgent's class can be loaded by JVM multiple times ! As far as the copying of globaly disabled plugin, it is bug, we should fix it. You can just remove unused plugins directly from hotswap-agent.jar as a workaround, it should help with performance.

합니다.