Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6886461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:45:44+00:00 2026-05-27T05:45:44+00:00

I am experiencing a weird problem with the Java ProcessBuilder . The code is

  • 0

I am experiencing a weird problem with the Java ProcessBuilder. The code is shown below (in a slightly simplified form)

public class Whatever implements Runnable
{

public void run(){
        //someIdentifier is a randomly generated string
        String in = someIdentifier + "input.txt";
        String out = someIdentifier + "output.txt";
        ProcessBuilder builder = new ProcessBuilder("./whateveer.sh", in, out);
        try {
            Process process = builder.start();
            process.waitFor();
        } catch (IOException e) {
            log.error("Could not launch process. Command: " + builder.command(), e);
        } catch (InterruptedException ex) {
            log.error(ex);
        }
}

}

whatever.sh reads:

R --slave --args $1 $2 <whatever1.R >> r.log    

Loads of instances of Whatever are submitted to an ExecutorService of fixed size (35). The rest of the application waits for all of them to finish- implemented with a CountdownLatch. Everything runs fine for several hours (Scientific Linux 5.0, java version “1.6.0_24”) before throwing the following exception:

java.io.IOException: Cannot run program "./whatever.sh": java.io.IOException: error=11, Resource temporarily unavailable
    at java.lang.ProcessBuilder.start(Unknown Source)
... rest of stack trace omitted...

Does anyone have an idea what this means? Based on the google/bing search results for java.io.IOException: error=11, it is not the most common of exceptions and I am completely baffled.

My wild and not so educated guess is that I have too many threads trying to launch the same file at the same time. However, it takes hours of CPU time to reproduce the problem, so I have not tried with a smaller number.

Any suggestions are greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:45:45+00:00Added an answer on May 27, 2026 at 5:45 am

    The error=11 is almost certainly the EAGAIN error code:

    $ grep EAGAIN asm-generic/errno-base.h 
    #define EAGAIN      11  /* Try again */
    

    The clone(2) system call documents an EAGAIN error return:

       EAGAIN Too many processes are already running.
    

    The fork(2) system call documents two EAGAIN error returns:

       EAGAIN fork() cannot allocate sufficient memory to copy the
              parent's page tables and allocate a task structure for
              the child.
    
       EAGAIN It was not possible to create a new process because
              the caller's RLIMIT_NPROC resource limit was
              encountered.  To exceed this limit, the process must
              have either the CAP_SYS_ADMIN or the CAP_SYS_RESOURCE
              capability.
    

    If you were really that low on memory, it would almost certainly show in the system logs. Check dmesg(1) output or /var/log/syslog for any potential messages about low system memory. (Other things would break. This doesn’t seem too plausible.)

    Much more likely is running into either the per-user limit on processes or system-wide maximum number of processes. Perhaps one of your processes isn’t properly reapting zombies? This would be very easy to spot by checking ps(1) output over time:

    while true ; do ps auxw >> ~/processes ; sleep 10 ; done
    

    (Maybe check every minute or ten minutes if it really does take hours before you’re in trouble.)

    If you’re not reaping zombies, then read up on whatever you must do to ProcessBuilder to use waitpid(2) to reap your dead children.

    If you’re legitimately running more processes than your rlimits allow, you’ll need to use ulimit in your bash(1) scripts (if running as root) or set higher limits in /etc/security/limits.conf for the nproc property.

    If you are instead running into the system-wide process limits, you might need to write a larger value into /proc/sys/kernel/pid_max. See proc(5) for some (short) details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm experiencing a (for me) very weird problem in Python. I have a class
I'm experiencing this weird problem which my scrollbar jumps by itself to somewhere that
I'm experiencing a weird problem with a SQL login. When I connect to the
Hi I'm experiencing a super weird problem. Whenever I post links to my website
I'm experiencing a weird situation with deleting files in Ruby, the code seems to
I'm experiencing this weird problem reading data from a table called nodes. Any select
I'm experiencing a weird problem which I hope someone in here may be able
I'm experiencing a weird problem with stringstream . #include stdafx.h #include iostream #include sstream
I am currently experiencing a weird caching problem it would seem. When I load
I have been experiencing a weird problem that I can't find a solution to.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.