# Memory usage with large JSON

**URL:** <https://discourse.julialang.org/t/memory-usage-with-large-json/51277>\
**Category:** Performance\
**Created:** [December 4, 2020, 9:38pm UTC](https://discourse.julialang.org/t/memory-usage-with-large-json/51277 "2020-12-04T21:38:12Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![evanfields](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evanfields/32/1744_2.png) [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Post date:** [December 4, 2020, 9:38pm UTC](https://discourse.julialang.org/t/memory-usage-with-large-json/51277/1 "2020-12-04T21:38:12Z")

</div>

I was using `JSON` to parse a large (1.6 GB) JSON file, and the memory usage was surprising. More surprisingly, perhaps, was that even after removing the reference to the parsed object and garbage collecting, the memory usage remained high:

```julia
using JSON
# write and parse a 25 byte JSON to compile
# Julia memory usage ~200 MB
d = JSON.parsefile("really_big.json")
# takes a long time
# Julia memory usage 12 GB
d = nothing
Base.GC.gc()
# Julia memory usage 8 GB

```

Is this pattern expected? Can anything be done to mitigate? Thanks!

---

_[View the full topic](https://discourse.julialang.org/t/memory-usage-with-large-json/51277)._
