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

  • SEARCH
  • Home
  • 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 6837957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:32:20+00:00 2026-05-26T23:32:20+00:00

I have a little executable program in C that produce a lot of output

  • 0

I have a little executable program in C that produce a lot of output to a file.
When I call this program with Runtime, like this:

Runtime r = Runtime.getRuntime();
Process p = null;

p = r.exec("./my_program -in input.file -out output.file", null, new File(System.getProperty("java.io.tmpdir")));

When the program produce low output everything is ok, but when I call “*my_program*” with a large input it will produce a large quantity of output to the output.file, but in this case my program in Java freeze and nothing happen…

I test “*my_program*” in terminal with a lot of large inputs and everything is ok, but when I call the program in Java with Runtime.exec, the Java program freeze.

—
Thanks in advance

  • 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-26T23:32:20+00:00Added an answer on May 26, 2026 at 11:32 pm

    Make sure you’re reading from the Process’s .getOutputStream() and .getErrorStream() if you aren’t already. Looking at your code snippet, it appears that you’re just executing .exec(...) (and maybe waiting for it to complete with a call not shown to .waitFor()?).

    Per http://download.oracle.com/javase/6/docs/api/java/lang/Process.html (emphasis added):

    The parent process uses these streams to feed input to and get output
    from the subprocess. Because some native platforms only provide
    limited buffer size for standard input and output streams, failure to
    promptly write the input stream or read the output stream of the
    subprocess may cause the subprocess to block, and even deadlock.

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

Sidebar

Related Questions

I have little question about how web browser retrieve webpage? I know this User
I have little doubt about string reading in C. string reading functions like gets,
I have little question. I found this on internet: Type t = typeof(MyClass); MethodInfo[]
I have a MainMenu in my app and I would like to have little
I'm refactoring on old Rails app, and I have a lot of little methods\helpers
So, I've written a neat little program that can analyse Japanese text and give
This is a little bit of weird problem here. Say I have a C++
I have a Windows application based on Java, that I should like to install
I've been working on this Haskell project, and I have a cabal file for
My question is pretty straightforward: You are an executable file that outputs Access granted

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.