I use the sh function from the clojure.java.shell command to read a very large output from the command. The output is about 60 million data.
I keep getting java.lang.OutOfMemoryError. Is there a way to open some kind of pipe that will allow me to read the result and analyze it into a vector. How lazy sequence to output the command?
Basically, the data is a large array of bytes, which I want to convert to just numbers and put into a vector.
clojure.java.shell/sh will always return a non-lazy string
( , ), lazy line-seq BufferedReader:
(->> (.exec (Runtime/getRuntime) "YOUR_LONG_RUNNING_COMMAND ARG ...") .getInputStream clojure.java.io/reader line-seq (map YOUR-FUNCTION))
Source: https://habr.com/ru/post/1772517/More articles:VS2010 Chart control: decreasing the Y axis field - asp.netHow to get effective permissions for a user in an AD LDS record in C #? - c #The quick string is replaced by a wildcard - stringС++: чтение из файла с нулевыми символами - c++MySQL Error 1054: Unknown column in a sentence - sqlIs it faster to allow PHP to parse a large file than calling data from a MySQL database? - performanceDoes AVAssetReader not read the entire file? - iosHow to get file name and line number in Perl? - perlIs it possible to implement a vertical scrollbar in a drop-down menu using only CSS? - javascriptOptimization: access to fields against methods - optimizationAll Articles