JVM thread stack (out of memory)

Discussion in 'Java' started by Chenxi, Nov 30, 2005.

  1. Chenxi

    Chenxi Guest

    Hi everyone,

    I am trying to run 10,000 threads on my machine, and the JVM reported
    thread stack out of memory. It is obvious that I have created too many
    threads (well, 2000 threads is fine, but not 10,000). I've tried to
    increase JVM memory allocation.

    java -Xms300m -Xmx300m -Xss4000k

    but still cannot create more threads, also i found that -Xss option
    didnt help, can anyone help?

    Chenxi
     
    Chenxi, Nov 30, 2005
    #1
    1. Advertising

  2. Chenxi

    Chris Uppal Guest

    Chenxi wrote:

    > I am trying to run 10,000 threads on my machine


    Unless you are using a machine with (at least) hundreds of CPUs, or are using a
    JVM with an implementation that is specifically designed for /very/ lightweight
    threads, nether of which is at all likely I think, then that is /far/ too many
    threads.

    -- chris
     
    Chris Uppal, Nov 30, 2005
    #2
    1. Advertising

  3. Chenxi wrote:
    >
    > but still cannot create more threads, also i found that -Xss option
    > didnt help, can anyone help?


    Isn't -Xss the size of each stack? In order not to run out of address
    space, you should set it as low as possible.

    Tom Hawtin
    --
    Unemployed English Java programmer
    http://jroller.com/page/tackline/
     
    Thomas Hawtin, Nov 30, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Hooke

    Re: Handling both MS JVM and Sun JVM

    Kevin Hooke, Aug 26, 2003, in forum: Java
    Replies:
    2
    Views:
    884
  2. Lasse
    Replies:
    1
    Views:
    709
    Jon A. Cruz
    Jan 5, 2004
  3. Young-Jin Lee

    MS JVM and Sun JVM problem

    Young-Jin Lee, Jan 20, 2004, in forum: Java
    Replies:
    3
    Views:
    581
    Mickey Segal
    Jan 21, 2004
  4. C B
    Replies:
    3
    Views:
    2,087
    David Hilsee
    Aug 12, 2004
  5. Replies:
    0
    Views:
    1,311
Loading...

Share This Page