write-object can retain head of collections

Description

If serializing a large data structure, the write-object function will retain head references, causing memory pressure.

The problem code looks to me like a typo:

https://github.com/clojure/data.json/blob/master/src/main/clojure/clojure/data/json.clj#L322

calling seq on the parameter of the function, rather than the loop variable. That keeps the parameter in-scope during the recursion.

Environment

None

Activity

Show:
Alex Miller
November 10, 2020, 7:30 PM

Agreed, fixed.

Fixed
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Unassigned

Reporter

import