Apologies for duplicates but I haven't been able to solve this issue from reading other posts. I am trying to run a computationally intensive iterative algorithm. The next iterate is given by a function "update" and I collect all the iterates via
(def iterates (doall (take 1000 (iterate update initial-state))))
where initial-state is the zeroeth iterate with which I am initializing the algorithm. Unfortunately I cannot supply a minimal example... update is quite a complicated function which takes a map datastructure as input and outputs an updated map datastructure. Code runs fine for total iterations up to 800 but then produces the error below for anything larger. General opinion is that merely increasing the size available to the garbage collector is not sufficient, as this is symptomatic of a deeper problem (perhaps). In other posts the problem presented are very specific, yet my update function is very complex. How then can I go about solving this in the generality provided here? Are there certain tooling utilities I can use?
Caused by java.lang.OutOfMemoryError GC overhead limit exceeded
Double.java: 519 java.lang.Double/valueOf Numbers.java: 611 clojure.lang.Numbers$DoubleOps/multiply Numbers.java: 148 clojure.lang.Numbers/multiply core.clj: 21 ssm4clj.core/corr core.clj: 6 ssm4clj.core/corr core.clj: 42 ssm4clj.core/innovation core.clj: 40 ssm4clj.core/innovation core.clj: 2522 clojure.core/partial/fn core.clj: 2646 clojure.core/map/fn LazySeq.java: 40 clojure.lang.LazySeq/sval LazySeq.java: 49 clojure.lang.LazySeq/seq RT.java: 521 clojure.lang.RT/seq core.clj: 137 clojure.core/seq core.clj: 2654 clojure.core/map/fn LazySeq.java: 40 clojure.lang.LazySeq/sval LazySeq.java: 49 clojure.lang.LazySeq/seq Cons.java: 39 clojure.lang.Cons/next RT.java: 688 clojure.lang.RT/next core.clj: 64 clojure.core/next protocols.clj: 168 clojure.core.protocols/fn protocols.clj: 124 clojure.core.protocols/fn protocols.clj: 19 clojure.core.protocols/fn/G protocols.clj: 31 clojure.core.protocols/seq-reduce protocols.clj: 75 clojure.core.protocols/fn protocols.clj: 75 clojure.core.protocols/fn protocols.clj: 13 clojure.core.protocols/fn/G core.clj: 6545 clojure.core/reduce core.clj: 6527 clojure.core/reduce core.clj: 347 ssm4clj.core/mean-conditional core.clj: 319 ssm4clj.core/mean-conditional REPL: 332 ipp4clj.multiplexing/update-single-gp-mean REPL: 329 ipp4clj.multiplexing/update-single-gp-mean