Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    problem with java in user account

    Hi all,

    I am running centOS in my desktop and create one account for my friend to use it too. However, he complained that he cannot run under his account, it always tells OutOfMemoryError
    java.lang.OutOfMemoryError: unable to create new native thread
            at java.lang.Thread.start0(Native Method)
            at java.lang.Thread.start(
            at java.util.concurrent.ThreadPoolExecutor.addIfUnderCorePoolSize(
            at java.util.concurrent.ThreadPoolExecutor.execute(
            at org.mortbay.thread.concurrent.ThreadPool.dispatch(
            at org.mortbay.jetty.AbstractConnector.doStart(
            at org.mortbay.jetty.nio.SelectChannelConnector.doStart(
            at org.mortbay.component.AbstractLifeCycle.start(
            at org.mortbay.jetty.Server.doStart(
            at org.mortbay.component.AbstractLifeCycle.start(
    But I still can use java using root account. I also check ulimit command and their are all unlimited.

    Maybe the problem is my computer, it has only 1GB.

    Would you please help me to solve this problem?

    Thank you

  2. #2
    Just Joined!
    Join Date
    May 2011

    If i'm not mistaken ulimit governs open files and other resources.
    The OOM issue could probably be about the JVM options not set.
    Using your friend's login try launchng the java app with:

    java -Xmx128m somejavaappname

  3. #3
    Hi aazkan,

    I also try your comment but the problem is still the same. Could you suggest me another ways?


  4. $spacer_open
  5. #4
    Just Joined!
    Join Date
    May 2011
    Hi again,

    Did it throw another OOM when you started the java app when you used user login? May I have a look at the error msg when you tried running with the Xmx set?
    Were you able to run the java app as root?

    Try running it with these options

    java -Xms128M -Xmx512M somejavaappname

    And also when you're running the java app, can you tell me what's your free -m output?

  6. #5
    Hi aazkan,

    Sorry for my late response,

    When I run java -jar myapp, the system throws this exception and terminate my job, so I cannot show you the result of command free -m during running this app. But this is the result of free -m when not running my app.

    $ free -m
                 total       used       free     shared    buffers     cached
    Mem:          1001        745        255          0        136        490
    -/+ buffers/cache:        118        882
    Swap:         2000          0       1999
    Moreover, running this app in another computer just takes only 30MB.

    I also create a new user, and this new user can run my app without any exceptions. This is so weird. Do you have any ideas for this?

    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts