umbracle / ethgo

Ethereum Golang API
https://www.ethgoproject.io
Mozilla Public License 2.0
484 stars 134 forks source link

Reset ArenaPool after use #250

Closed jp-imx closed 1 year ago

jp-imx commented 1 year ago

I believe we are hitting a memory leak in fastjson discussed here: https://github.com/valyala/fastjson/issues/24

This PR resets the fastjson.ArenaPool object after using it. It means we won't get cache hits across calls to MarshalJSON but given the cardinality of the data in blocks and transactions, I expect the impact to be minimal.

Happy to discuss if my assumption if incorrect.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ethgo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 3, 2023 5:11am