Clojure

Agent sends consume heap

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: Release 1.3
  • Fix Version/s: Release 1.4
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code
  • Approval:
    Ok

Description

Simple demonstration:

(defn update [state]
  (send *agent* update)
  (inc state))

(def a (agent 1))

(send a update)

On Clojure 1.2.1, this runs forever with no problem. On 1.3.0, it throws "java.lang.OutOfMemoryError: Java heap space."

The problem appears to be clojure.core/binding-conveyor-fn: each send creates a new Var binding frame, and nested send creates an infinite stack of frames.

Also discussed at https://groups.google.com/d/topic/clojure/1qUNPZv3OYA/discussion

Activity

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: