dominictarr / JSONStream

rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)
Other
1.91k stars 165 forks source link

Memory leak regression in 1.3.3 #153

Closed andershessellund closed 6 years ago

andershessellund commented 6 years ago

I use JSONStream to parse large GeoJSON files and stream them to a database.

In the last version, parsing a large GeoJSON feature collection fails due to an out of memory error.

This happens because of a memory leak introduced in version 1.3.3. Version 1.3.2 works fine.

In particular, this commit is the culprit:

https://github.com/dominictarr/JSONStream/commit/8c1206e2ab2e069997d105cedc966efd80eefa57#diff-168726dbe96b3ce427e7fedce31bb0bcL118

Re-adding the line "delete this.value[this.key]" fixes the problem.

junajan commented 6 years ago

+1

daern91 commented 6 years ago

We are also getting this... Thanks a lot for finding the problem @andershessellund. I made PR #154 as this is a crucial part of our open-source SDKs.

regevbr commented 6 years ago

Same here!