title: Gradle: java.io.IOException: The pipe is being closed
body: <p>On my CI machine (Windows 10) I run Gradle tests.
  Basically on the machine a git pull and a java compile is performed before the test task.</p>
  
  <hr>
  
  <p>This task...</p>
  
  <blockquote>
    <p>test --tests my.package.SomeTestClass</p>
  </blockquote>
  
  <p>failed with this exception...</p>
  
  <pre><code>00:00:32,989 INFO  - Successfully started process 'Gradle Test Executor 1'
  00:00:35,925 INFO  - Error occurred during initialization of VM
  00:00:35,927 INFO  - Unable to allocate 16384KB bitmaps for parallel garbage collection for the requested 524288KB heap.
  00:00:35,927 ERROR - Error: Could not create the Java Virtual Machine.
  00:00:35,929 ERROR - Error: A fatal exception has occurred. Program will exit.
  00:00:35,930 INFO  - 
  00:00:35,930 ERROR - Could not write standard input to Gradle Test Executor 1.
  00:00:35,932 ERROR - java.io.IOException: The pipe is being closed
  00:00:35,932 ERROR -     at java.io.FileOutputStream.writeBytes(Native Method)
  00:00:35,934 ERROR -     at java.io.FileOutputStream.write(FileOutputStream.java:326)
  00:00:35,934 ERROR -     at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
  00:00:35,934 ERROR -     at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
  00:00:35,934 ERROR -     at org.gradle.process.internal.streams.ExecOutputHandleRunner.forwardContent(ExecOutputHandleRunner.java:67)
  00:00:35,934 ERROR -     at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:52)
  00:00:35,934 ERROR -     at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
  00:00:35,934 ERROR -     at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
  00:00:35,934 ERROR -     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  00:00:35,934 ERROR -     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  00:00:35,934 ERROR -     at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
  00:00:35,934 ERROR -     at java.lang.Thread.run(Thread.java:748)
  00:00:35,934 INFO  - 
  00:00:35,935 INFO  - &gt; Task :test FAILED
  </code></pre>
  
  <p>I am using the Gradle wrapper 5.4.1.
  My gradle.properties looks like:</p>
  
  <pre><code>org.gradle.daemon=false
  org.gradle.jvmargs=-Xmx2g
  </code></pre>
  
  <p>I experienced the same issue some months back when I enabled the Gradle daemon.</p>
  
  <p>I am monitoring my CI machines and I can see that at this time the machine had about 750MB free memory which is more than the required 512MB (see exception).
  Not sure if this is relevant but the node is running the Quickbuild agent.</p>
  
  <hr>
  
  <p>What does this error exactly mean and how can I get rid of it? </p>