Multi-threaded application crashing the VM

Hi,

I have a multi-threaded (about 120 threads) application which crashes without after running for a while.

I get this in the windows event viewer

Faulting application java.exe, version 0.0.0.0, faulting module kernel32.dll, version 5.2.3790.0, fault address 0x000017b1.

Anyone knows why this would happen?

- vineet

[353 byte] By [vineetb] at [2007-9-30 17:30:38]
# 1
Which version of the JVM?Are you using the -server option?Check out this: http://java.sun.com/docs/hotspot/threads/threads.htmland/or file a bug.-Alexis
am74686 at 2007-7-6 13:53:39 > top of Java-index,Administration Tools,Sun Connection...
# 2

Hi Alexis,

Thanks for the response to my post!!

> Which version of the JVM?

C:\>java -version

java version "1.4.2_05"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)

Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

> Are you using the -server option?

I was not using this option earlier but even on using this the jvm crashes after running for sometime.

I am using these jvm options now -

java -server -Xss128K -Xms256M -Xmx512M

- vineet

vineetb at 2007-7-6 13:53:39 > top of Java-index,Administration Tools,Sun Connection...
# 3

what kind of application are you running (app server?).

What is the reason for using the -Xss option? How many threads do you have?

Can you give JDK 5.0 a try?

You can also try running with the -client option (may be slower, but if it doesn't fail, it may mean there's a bug in the server compiler).

I'm not familiar with Windows thread libraries (can you switch to an alternate library?)

-Alexis

74686 at 2007-7-6 13:53:39 > top of Java-index,Administration Tools,Sun Connection...
# 4

So finally, I got rid of this crash after installing J2SE 5.0RC on windows 2003.

I was also using a bad ThreadPool - did not remove inactive threads, did not respect the maximum allowed thread count.

I changed the code to use Doug Lea's thread pool (PooledExecutor). I am going to convert over to the ThreadPool in java.util.concurrent in the future.

- vineet

vineetb at 2007-7-6 13:53:39 > top of Java-index,Administration Tools,Sun Connection...