title: What is the size of standard output buffer size?
body: <p>I am writing lot of data to the stdandard output and I remark that according to the output console the program execution time is variable. The program is slower on NetBeans console than in Windows cmd for example.</p>
  
  <p>So i think writing to stdout fill a buffer and writing become blocking when this buffer is full (the console  output doesn't consume fast enough).</p>
  
  <p>I reproduce this behavior with a Java program.</p>
  
  <p>Here a program that output data . </p>
  
  <pre><code>public class Output {
  
      public static void main(String[] args) {
          long start = System.currentTimeMillis();
  
          for (int i = 0; i &lt; 10_000; i++) {
              System.out.println("Awesone Output ");
          }
  
          System.out.println("Total time : " + (System.currentTimeMillis() - start));
      }
  
  }
  </code></pre>
  
  <p>And here a program that consume data from the above program</p>
  
  <pre><code>public class StdoutBlocking {
  
      public static void main(String[] args) throws IOException, InterruptedException {
  
          ProcessBuilder processBuilder = new ProcessBuilder("java", "stackoverflowDemo.StdoutBlocking.Output");
          processBuilder.directory(new File("C:/Users/me/Documents/NetBeansProjects/tmp/build/classes"));
          Process process = processBuilder.start();
  
          BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
          String line = null;
          String lastLine = null;
  
          while ((line = reader.readLine()) != null) {
              Thread.sleep(10);
              lastLine = line;
          }
          System.out.println("done : " + lastLine);
  
      }
  }
  </code></pre>
  
  <p>I launch the second one that start output and consume its output.
  Without sleep the Output program is really quick with it's very slow.</p>
  
  <p>So what is the size of this buffer ??</p>
  
  <p>This is just for my Curiosity i'am not trying to achieve Something particular</p>