From 13fa72f1d16cd9544b58ee286bb1aac331fef4bb Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Mon, 9 Nov 2020 12:03:32 +0100 Subject: [PATCH] README [skip ci] --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1f8b8f16..3175c8e8 100644 --- a/README.md +++ b/README.md @@ -873,15 +873,14 @@ If memory usage is a concern and you are downloading big files, choose holds the entire response in memory at once. Let's download a 200mb file with 10mb heap size: -``` shell +``` clojure $ bb -Xmx10m -e '(io/copy (:body (curl/get "http://ipv4.download.thinkbroadband.com/200MB.zip" {:as :stream})) (io/file "/tmp/200mb.zip"))' ``` -With `babashka.curl` this forks fine. However with `org.httpkit.client` that +With `babashka.curl` this works fine. However with `org.httpkit.client` that won't work. Not even 190mb of heap will do: -``` shell - +``` clojure $ bb -Xmx190m -e '(io/copy (:body @(org.httpkit.client/get "http://ipv4.download.thinkbroadband.com/200MB.zip" {:as :stream})) (io/file "/tmp/200mb.zip"))' Sun Nov 08 23:01:46 CET 2020 [client-loop] ERROR - select exception, should not happen java.lang.OutOfMemoryError: Array allocation too large.