Debugging a webapp is very slow

Okay, this has been plaguing me for the last couple of days, and it is very frustrating. I think I have determined it is an IntelliJ problem, but, I am not sure...I hope you follow along and could provide me some insight or direction...

I am developing a webapp. It's a messageboard web application. We are using Spring 1.2.5 and Hibernate 3.0.5 along with a number of other libraries. We are running the app on Resin 2.1.16 along with the Resin plugin to IntelliJ.

When we run the application normally (click Run, not Debug), the application performs as expected. Spring initializes it's context, Hibernate loads it's mapping files, and I am a happy developer. When we run the application in Debug mode though, the application is very very slow to load. The log statements trickle onto the screen, and the application takes on the order of 2 minutes to load when before it took something like 10 seconds. Also, during this slow load time, one of my processors is maxed out at 99% CPU usage. Usually, the application initialization hits more than the one processor, but in debug mode, it only hits the one.

If I just wait, the app eventually loads, but each subsequent request is still slow...especially if any database access is involved. But, that said, I don't think this is a Hibernate problem, or a Spring problem, or an webapp server problem...I will explain below...

I have run the application in Resin 2.1.16, 3.x, and on Tomcat 5.x, and the same behavior persists. Slow in Debug, fast in normal Run. I have also tried different versions of hibernate (3.0.5 and 3.1 beta 3) to the same conclusion. Spring is currently the newest release version (1.2.5) and I've not experimented changing that. I have run the app with JDK 1.4.2_08 and 1.5.0_05, and both have the same results. I have also tested running the app in IntelliJ 5.0.1 and the latest EAP (build 3512) with the same results.

Now, perhaps most interesting...if I run the app in debug mode outside of IntelliJ (ie: from the command line with “-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7799”, as supplied by IntelliJ), the app loads like a champ. Fast and furious! Now, if I attach IntelliJ to that remote process for debugging, things immediately slow down in the same way as described above. Now, if I attach another IDE to the same process (I tried NetBeans 5.0 beta), things ran fast and normal.

So, what can I do?! Does anyone have any other steps they think I should try to debug this? JetBrains? If there is any other information I should provide, let me know.

Thanks for reading to this part. Cheers.

5 comments

I forgot to mention, I am running on Suse 9.3 Professional. I have not tried testing any of this on a windows machine.

0

You can set the method/field watch point accidentally (Run -> View break
points)

Eric Webb wrote:

Okay, this has been plaguing me for the last couple of days, and it is very frustrating. I think I have determined it is an IntelliJ problem, but, I am not sure...I hope you follow along and could provide me some insight or direction...

I am developing a webapp. It's a messageboard web application. We are using Spring 1.2.5 and Hibernate 3.0.5 along with a number of other libraries. We are running the app on Resin 2.1.16 along with the Resin plugin to IntelliJ.

When we run the application normally (click Run, not Debug), the application performs as expected. Spring initializes it's context, Hibernate loads it's mapping files, and I am a happy developer. When we run the application in Debug mode though, the application is very very slow to load. The log statements trickle onto the screen, and the application takes on the order of 2 minutes to load when before it took something like 10 seconds. Also, during this slow load time, one of my processors is maxed out at 99% CPU usage. Usually, the application initialization hits more than the one processor, but in debug mode, it only hits the one.

If I just wait, the app eventually loads, but each subsequent request is still slow...especially if any database access is involved. But, that said, I don't think this is a Hibernate problem, or a Spring problem, or an webapp server problem...I will explain below...

I have run the application in Resin 2.1.16, 3.x, and on Tomcat 5.x, and the same behavior persists. Slow in Debug, fast in normal Run. I have also tried different versions of hibernate (3.0.5 and 3.1 beta 3) to the same conclusion. Spring is currently the newest release version (1.2.5) and I've not experimented changing that. I have run the app with JDK 1.4.2_08 and 1.5.0_05, and both have the same results. I have also tested running the app in IntelliJ 5.0.1 and the latest EAP (build 3512) with the same results.

Now, perhaps most interesting...if I run the app in debug mode outside of IntelliJ (ie: from the command line with ?-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7799?, as supplied by IntelliJ), the app loads like a champ. Fast and furious! Now, if I attach IntelliJ to that remote process for debugging, things immediately slow down in the same way as described above. Now, if I attach another IDE to the same process (I tried NetBeans 5.0 beta), things ran fast and normal.

So, what can I do?! Does anyone have any other steps they think I should try to debug this? JetBrains? If there is any other information I should provide, let me know.

Thanks for reading to this part. Cheers.



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Sounds like a big problem. It could be IDEA.

I know java slows down with this option:

-Djava.compiler=NONE JDK 1.1 and 1.2 only. This option disables the JIT,
which is required for JDK versions 1.1 and 1.2.

But you said it runs fine from the command line. Is it possible to enable
the JIT and still be able to debug? Because the only time when java slows
down(that I have seen), is when it runs in interpreted mode?

Just to give you more ideas. When Idea communicates with the app, could it
be a bottleneck in some protocol?

I hope you figure this out.

Okay, this has been plaguing me for the last couple of days, and it is
very frustrating. I think I have determined it is an IntelliJ
problem, but, I am not sure...I hope you follow along and could
provide me some insight or direction...

I am developing a webapp. It's a messageboard web application. We
are using Spring 1.2.5 and Hibernate 3.0.5 along with a number of
other libraries. We are running the app on Resin 2.1.16 along with
the Resin plugin to IntelliJ.

When we run the application normally (click Run, not Debug), the
application performs as expected. Spring initializes it's context,
Hibernate loads it's mapping files, and I am a happy developer. When
we run the application in Debug mode though, the application is very
very slow to load. The log statements trickle onto the screen, and
the application takes on the order of 2 minutes to load when before it
took something like 10 seconds. Also, during this slow load time, one
of my processors is maxed out at 99% CPU usage. Usually, the
application initialization hits more than the one processor, but in
debug mode, it only hits the one.

If I just wait, the app eventually loads, but each subsequent request
is still slow...especially if any database access is involved. But,
that said, I don't think this is a Hibernate problem, or a Spring
problem, or an webapp server problem...I will explain below...

I have run the application in Resin 2.1.16, 3.x, and on Tomcat 5.x,
and the same behavior persists. Slow in Debug, fast in normal Run. I
have also tried different versions of hibernate (3.0.5 and 3.1 beta 3)
to the same conclusion. Spring is currently the newest release
version (1.2.5) and I've not experimented changing that. I have run
the app with JDK 1.4.2_08 and 1.5.0_05, and both have the same
results. I have also tested running the app in IntelliJ 5.0.1 and the
latest EAP (build 3512) with the same results.

Now, perhaps most interesting...if I run the app in debug mode outside
of IntelliJ (ie: from the command line with ?-Xdebug -Xnoagent
-Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7799?, as
supplied by IntelliJ), the app loads like a champ. Fast and furious!
Now, if I attach IntelliJ to that remote process for debugging, things
immediately slow down in the same way as described above. Now, if I
attach another IDE to the same process (I tried NetBeans 5.0 beta),
things ran fast and normal.

So, what can I do?! Does anyone have any other steps they think I
should try to debug this? JetBrains? If there is any other
information I should provide, let me know.

Thanks for reading to this part. Cheers.



0

Wow...you are good.

Thanks so much. That did the trick.

cheers,
eric

0

Not at all.
I had this problem week ago :)))

Eric Webb wrote:

Wow...you are good.

Thanks so much. That did the trick.

cheers,
eric



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Please sign in to leave a comment.