
Signature
Daniel Dyer
https://watchmaker.dev.java.net - Evolutionary Algorithm Framework for Java
> > I recently ported a high-transaction application I wrote in Java 1.3
> > to 1.5 and discovered a possible thread issue. The evidence suggests
[quoted text clipped - 27 lines]
> --
> Daniel Dyerhttps://watchmaker.dev.java.net- Evolutionary Algorithm Framework for Java
Thanks for the input.
Yes, I did run the 1.3 version on the same machine. As for the ulimit,
the same shell environment invoked both Java virtual machines. In fact
the only real difference between the versions was the URLDecoder and
URLEncoder classes as they both want encoding Strings where in version
1.3 the classes didn't. Otherwise, the code, environment, operating
system, and hardware are identical.
Chris
Patricia Shanahan - 01 Mar 2007 23:28 GMT
>>> I recently ported a high-transaction application I wrote in Java 1.3
>>> to 1.5 and discovered a possible thread issue. The evidence suggests
[quoted text clipped - 30 lines]
>
> Chris
Have you tried adjusting the number of threads to measure the extent of
the problem?
If slightly more threads on the earlier version breaks, and slightly
fewer threads on the later version works, it may be simply the general
tendency of software to grow with age.
Patricia
Robert Klemme - 02 Mar 2007 09:38 GMT
> Have you tried adjusting the number of threads to measure the extent of
> the problem?
>
> If slightly more threads on the earlier version breaks, and slightly
> fewer threads on the later version works, it may be simply the general
> tendency of software to grow with age.
Good point! Another idea: the newer JVM could be more optimized thusly
yielding a higher thread creation rate. If those threads are short
lived this could lead to earlier resource exhaustion.
Another difference might be that the newer JVM allocates more resources
for threads, especially stacks. You could try to explicitly set the
same thread stack size via -Xss<size> as Daniel suggested and see how
things go.
Kind regards
robert
Daniel Dyer - 01 Mar 2007 23:56 GMT
>> > I run this application on Linux and Solaris. The thread issue has been
>> > observed only on Linux with jdk-1_5_0_06-linux-i586.bin from Sun as I
[quoted text clipped - 13 lines]
> 1.3 the classes didn't. Otherwise, the code, environment, operating
> system, and hardware are identical.
I would speculate that 1.5 has a different strategy for mapping Java
threads to native threads than 1.3. I think there have been at least 3
different implementations used by Sun's JVMs. Prior to version 1.3, the
Linux JVM used "green threads". I don't recall how things have changed
since then.
What does "ulimit -a" say? I'm betting it's less than 800, so if there is
a difference in threading implementation you could run up against this
limit.
Alternatively, if the error really is what it says, i.e. a lack of memory,
you could try dropping the thread stack size with the -Xss switch. I'm
not convinced this will make much difference since 800 threads would only
use 200mb for the thread stacks. You shouldn't start getting this kind of
error until the sum of thread stacks and heap space exceeds 2 gigabytes
(on a 32-bit machine).
Dan.

Signature
Daniel Dyer
https://watchmaker.dev.java.net - Evolutionary Algorithm Framework for Java