views:

291

answers:

2

Recently I created a maven based web project and used tomcat as application server to debug ...

But tomcat is frequently dead (pergem error which means out of memery ) after run app from the Project context menu directly.

The worst is that It created many idle threads and they are all can not be killed by manually.

And tomcat status is also can not be detected by NetBeans, it can not be stop and restart. I must restart my system to clean them.

My system is Fedora 12 x86... Java version is SUN JDK 6 update 17. NetBeans verison is 6.7.1.

I tried to create a bug about this, but the NetBeans developer rejected it ... I am very surprise this is a big stopper to use NetBeans to develop web app.

Today I used JBoss 5.1 in the latest NetBeans 6.8rc1 and also encountered the same problem... I've tried adjusted the VM parameters and allocate more memory but no effects.

I've deployed several seam samples to JBoss 5.1 via seam ant build script , and there is no problem. But I switch to use NetBeans to do this, It failed due to Out of memory.

What is wrong????

+3  A: 

I tried to create a bug about this, but the NetBeans developer rejected it ... I am very surprise ...

I'm very unsurprised. This is not really a NetBeans problem. It is not even really a Tomcat or JBoss problem.

The root problem is that you cannot safely kill threads in a running JVM. And without the ability to do this you cannot stop leakages of (in this case) permgen space. This is essentially a Java platform problem. It can only be solved when JVMs support the Isolate mechanisms defined by JSR 121.

... this is a big stopper to use NetBeans to develop web app.

The solution is to restart your web container every now and then to clean out the idle threads and release the leaked permgen space. You can ameliorate it by running with a larger heap and more permgen, but you cannot make it go away, especially if some of the orphaned threads are not idle ...

Oh yea, and don't be a big baby! This ain't a show stopper, its a small inconvenience :-)

Stephen C
A: 

Check if JRebel does support your current configuration, maybe it can solve your problem: http://www.zeroturnaround.com/jrebel/

penguintux