[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Serious problems with Java & threads on stable & unstable... (?)

On a 2.4 kernel, a combination of ulimit and /proc/sys/kernel/threads-max is your limit for "regular" processes. For threads, additional limitations may be imposed by:

- the JVM. Prior to 1.3, the Sun JVM's assumed a 2MB stack, imposing a hard limit of 1024 threads.

- your threads implementation. From the top of my head, prior to around 0.7, LinuxThreads also hard-coded a 2MB stack for threads

Note that whenever the JVM can't create a new thread, you'll get an OutOfMemoryError, regardless of whether that's due to a lack of memory, or permissions, or thread resources. (Again, my only experience is with Sun's JVMs).

On 6/13/2002 12:47 PM, Adam Majer wrote:
On Wed, Jun 12, 2002 at 06:44:47PM +0200, Philipp Meier wrote:

On Tue, Jun 11, 2002 at 10:07:35PM -0500, Adam Majer wrote:

On Thu, May 16, 2002 at 10:32:06AM -0700, A.J. Rossini wrote:

"tony" == tony mancill <tony@mancill.com> writes:

   tony> For both cases, would it possible to post the kernel version of the test
   tony> box?  Maybe it's part of the equation.

(I actually did, privately, to Bill, forgot to cc the list).

I'm running 2.4.18, on a dual P2 1.0 Ghz box, 512Mb/2Gb swap.

turns out it might be a process limit problem.

Yes. By deafault the max number of threads is set to 320. Well, at least on my
486 box. On Athlon I have it as 8k.


If it says it can't fork, then it is threads-max that's the problem.

It even might be the shell, my standard debian zsh e.g. limits the
number um threads to 256:

billy@farpoint:~/ > ulimit -u

It might help to set it higher:

billy@farpoint:~/ > ulimit -u 8192

ulimit is very useless. At least that's my opinion. The hadlimit for 2.2.x kernels
is set in include/linux/tasks.h in the kernel source. The think is NR_TASKS which I
think is set to 512. There is also 2 lines below that might be interresting ie. the
ordinary user can only make NR_TASKS/2 no matter what umit is.

- Adam

Damian Morris

Director, Quality Assurance
Gaming & Entertainment Technology


Phone:  (+61) 2 9419 2000
Mobile: (+61) 412 808 307

To UNSUBSCRIBE, email to debian-java-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: