Neuroglancer memory leak
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 389
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 3
Description
Hello,
trying to solve the decompression speed problem form #358 with @jmrk84, we have stumbled upon a possible memory leak in Neuroglancer.
We firstly thought it was WASM library dependent (i.e. because of [@evan/wasm](https://www.npmjs.com/package/@evan/wasm) ), but after also trying out the Hemibrain and H01 data sets, we quickly realized it was a general issue that crashes the tab.
The memory leak arises after browsing the data for some time and loading different scaled chunks. The RAM quickly grows and surpasses ~4GB, sometimes even accessing more than 20GB of memory. This happens regardless of the option in Neuroglancer to limit the system memory. We tried this with a lower setting (100MB) and the problem persisted way past that limit.
The issue is more prominent in Chrome, as Firefox just stops loading more chunks after the memory cap and just freezes.
Also, we have found out that loading with a bigger chunk size accelerates the memory leak.
I have attached some error log images to this issue, I hope they help. If we could be of further help, don't hesitate to contact us.
Best regards,
MPI KornfeldLab


Here, _backend.ts_ is from [chunk_manager/backend.ts](https://github.com/google/neuroglancer/blob/master/src/neuroglancer/chunk_manager/backend.ts#L409) .

This is when the tab crashes.
Contributor guide
Assessment
This issue has not been assessed yet.