google / google/neuroglancer

Neuroglancer memory leak

Open
#359 7 comments 0 reactions 0 assignees View on GitHub
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

![memError](https://user-images.githubusercontent.com/50270260/145385458-cf71d83f-044f-4791-bbee-2b8d0ef2c04a.png)

![Screenshot from 2021-12-09 12-05-07](https://user-images.githubusercontent.com/50270260/145385500-d04e58a4-614c-48c3-855b-179c203421ca.png)

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

![Screenshot from 2021-12-09 12-05-42](https://user-images.githubusercontent.com/50270260/145385517-f09a7420-a0e7-4ef1-b95b-fbd97c8800c7.png)

This is when the tab crashes.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.