Skip to content

Instantly share code, notes, and snippets.

@pjstadig
Created June 3, 2015 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjstadig/202c82d3e9a3fb32bd5a to your computer and use it in GitHub Desktop.
Save pjstadig/202c82d3e9a3fb32bd5a to your computer and use it in GitHub Desktop.
Reproduction case for loop destructuring holding head of sequence. Am I doing it wrong?
user=> (loop [xs (repeatedly 200 #(byte-array (quot (.maxMemory (Runtime/getRuntime)) 10)))] (when (seq xs) (recur (rest xs))))
nil
user=> (loop [[x & xs] (repeatedly 200 #(byte-array (quot (.maxMemory (Runtime/getRuntime)) 10)))] (when (seq xs) (recur xs)))
OutOfMemoryError Java heap space clojure.lang.Numbers.byte_array (Numbers.java:1252)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment