#Problem faced
I am new to Scala and rusty in Java.
When running the top command it throws an exception that I am not capturing properly and I dont see where the error seems to be or how could I correct it. As you can see in the output, the results are given properly, but the exception is always thrown. Ideas?
I/O error Pipe closed for process: [top, -b1]
java.io.IOException: Pipe closed
at java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:260)
at java.io.PipedInputStream.awaitSpace(PipedInputStream.java:268)
at java.io.PipedInputStream.receive(PipedInputStream.java:231)
at java.io.PipedOutputStream.write(PipedOutputStream.java:149)
at scala.sys.process.BasicIO$.loop$1(BasicIO.scala:236)
at scala.sys.process.BasicIO$.transferFullyImpl(BasicIO.scala:242)
at scala.sys.process.BasicIO$.transferFully(BasicIO.scala:223)
at scala.sys.process.ProcessImpl$PipeThread.runloop(ProcessImpl.scala:159)
at scala.sys.process.ProcessImpl$PipeSource.run(ProcessImpl.scala:179)
Total Memory [7,69 GB]
Used Memory [7,45 GB]
Free Memory [0,24 GB]
Available Memory [0,00 GB]
I haven't tried so far but, have you tried invoking
.lines
instead of.!!
? Sincetop
command output is not finite, maybe using aStream[String]
would be a good idea...