core.async

onto-chan retains head of input sequence causing OutOfMemoryError

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    org.clojure/core.async 0.1.242.0-44b1e3-alpha
  • Patch:
    Code
  • Approval:
    Triaged

Description

(require '[clojure.core.async :as a])
(let [c (a/chan)]
  (a/onto-chan c (iterate inc 0))
  (while true
    (a/<!! c)))

onto-chan is holding on to the head of the input sequence as it is unfolded, resulting in an (eventual) OutOfMemoryError.

I've attached a diff showing changes I made to onto-chan that fixed the problem for me.

Activity

Rich Hickey made changes -
Field Original Value New Value
Assignee Rich Hickey [ richhickey ]
Alex Miller made changes -
Approval Triaged [ 10120 ]
Description Consider the following example:

(let [c (a/chan)]
  (a/onto-chan c (iterate inc 0))
  (while true
    (a/<!! c)))

onto-chan is holding on to the head of the input sequence as it is unfolded, resulting in an (eventual) OutOfMemoryError.

I've attached a diff showing changes I made to onto-chan that fixed the problem for me.
{code}
(require '[clojure.core.async :as a])
(let [c (a/chan)]
  (a/onto-chan c (iterate inc 0))
  (while true
    (a/<!! c)))
{code}

{{onto-chan}} is holding on to the head of the input sequence as it is unfolded, resulting in an (eventual) OutOfMemoryError.

I've attached a diff showing changes I made to onto-chan that fixed the problem for me.
Labels memory

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: