2017-04-08 7 views
4

私はJboss EAP 6.1に展開しているEARプロジェクトがあります。私のMavenのビルドの製品は次のようになります。JBoss EAP 6.1のHotswap-agent - java.lang.OutOfMemoryError:PermGenのスペース

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のログに何を得るのです。

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'. 

問題があります私がjbossに耳を入れたときには通常の10倍の時間がかかります。ブラウザからアプリケーションにアクセスしようとすると、 "PermGen space:java.lang.OutOfMemoryError:PermGen space"がスローされます。 PermGenメモリを700MBに増やしても飽き飽きしました。だから私はhotswap-agentがlibディレクトリにあるものを含めて私のEAR内のすべてのクラスを見ていると思っていたので、あまりにも多くのメモリを消費していました。

次に見てきたのは、hotswap-agent.propertiesにautoHotswap = falseを設定することで、デフォルトでhotswapを無効にすることです。上記のようにこのファイルをEARに配置しようとしましたが、EJBとWARのクラスパスは違いはありませんでした。また、私はそうのようなJVM_OPTSに追加して、無駄に、試してみました:

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

は、だから私の質問はどのように1は、私の環境でホットスワップ・エージェントを制御しない、のですか?また、指定されたパッケージ内のクラス、例えば "com.foobar"だけを見る方法もありますか?最後に、jbossのear展開用にhotswap-agentを設定する正しい方法は何ですか?

答えて

3

最後にhotswap-agent forumVladimirの助けを借りて、私のプロジェクトでhotswap-agentが動作しました。

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.

私は合理的な時間とPermGenメモリ内のJBoss開始することができますjarファイルから不要なプラグインを削除したら:彼は暴走PermGenメモリを解決する助けたことを言ったこれ。

関連する問題