Is is possible to have a clean undeploy in Glassfish?

不羁的心 提交于 2019-12-24 03:24:08

问题


I realized that any application which uses hibernate, fails to undeploy completely in Glassfish 2.1.1. Many classes remain in memory after the undeployment process, you can check it using jmap and jhat.

I've done several tests, and figured out that only applications which had hibernate failed to have a clen undeploy process. My Database provider for Hibernate in all the cases were jTDS 1.2.5.

You don't even need to run the application. If you just deploy, and instantly undeploy, you will realize several classes in memory, many from your application and many from hibernate and its dependencies.

Is it possible to have a clean undeploy in Glassfish v2.1.1? I'm running out of permgen space all the time.


回答1:


This is not a definitive answer, but it can at least minimize glassfish related undeployement issues, if you are using hibernate:

  • Don't use enums in your entities. Create regular classes instead.
  • Annotate only methods, don't annotate properties.

These two items can help minimizing problems, but don't get them rid of your development environment. Even if you don't use hibernate, your sesion beans stay forever in memory even after undeployement.



来源:https://stackoverflow.com/questions/2201621/is-is-possible-to-have-a-clean-undeploy-in-glassfish

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!