Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] It takes too long to unload any memory used for previously cached images or volumes #1407

Closed
jyotirmayzamre opened this issue Jul 30, 2024 · 1 comment

Comments

@jyotirmayzamre
Copy link

Describe the Bug

I have a React component which uses cornerstone 3D for a viewer interface. I am fetching a study from an Orthanc server and displaying the images. I am using purgeCache() and I am destroying all created volumes in ComponentWillUnmount. However, I have noticed two things. If I load the webpage that contains the component, the JS heap size shoots to around 30 Mb. This is to be expected. If I refresh the page, the heap size temporarily shoots up to around 55-60 Mb but then comes back down to 30 Mb. This is probably the browser garbage collecter's doing (or maybe something else).

If I redirect to a different route in my web app and open the page with the component again, it shoots up to 60 Mb and stays there for quite some time (roughly 15 minutes) before it unloads previous memory and comes back down to around 30. I am using Brave.

Is this an issue with how I'm unloading the cache? or maybe something in my web app? I am just caching the image metadata and the volumes that get created. Ideally, the unmount function should run whenever I go to a different route.

Any help would be appreciated.

Steps to Reproduce

I cannot give steps to reproduce without giving all of my code. I will post some snaps of the memory size before and after.

When first loaded:
image

After redirecting and opening page again:
image

The current behavior

Memory is taking too long to unload when I redirect and come back to the interface.

The expected behavior

I am purging the cache so it should come back down to around 30 Mb quickly.

OS

Windows 10

Node version

v20.14.0

Browser

Brave

Copy link
Member

sedghi commented Nov 6, 2024

I don't think this exists anymore after the release of Cornerstone 3D 2.0. I'm going to close this, but feel free to reopen it if it's still an issue.

@sedghi sedghi closed this as completed Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants