Open dereklukacs opened 2 years ago
i'd do this progressively using wasm/emscripten. Your last two points can be solved using pthreads to decode all frames which would be done off the main browser thread (non-blocking) and in-effect it would use less memory.
Thanks for the reply @nullhook, I am not sure I understand what you mean though. Isn't this package already running everything on wasm?
i believe it uses web workers to decode frames not wasm.
based on this file it looks like wasm port is in progress and doesn't work yet.
edit: I do see some decoders with wasm imports. however, i still think this can be improved if frames were decoded on the gpu
@dereklukacs do you have the file in question to upload?
This is related to issue #71
To free the worker memory, I use this code
cornerstoneWADOImageLoader.webWorkerManager.terminate();
@Ouwen I cannot share unfortunately.
@nyacoub Yes that seems precisely related and we have also noticed it being worse in chrome. I'll try your proposed workaround. Thanks!
@dereklukacs does this PR fix your issue?
Hi @Ouwen I'll try this out today, based on the description it sounds like it should fix the issue.
@nyacoub
This seems to help fix the runaway memory problems, thanks!
@dereklukacs @Ouwen
could you please let me know how can I use this solution to solve out of memory problem ?
Hi @muhammedmokbel you'll need to run the following steps.
npm run build
within the root of this repoyarn link
within the root of this repoyarn link cornerstone-wado-image-loader
in the Viewer or the repo(s) you are working in.sorry for being late @Ouwen thank you so much
This is related to issue #71 To free the worker memory, I use this code
cornerstoneWADOImageLoader.webWorkerManager.terminate();
@nyacoub could you please tell us where we can use this code?
@chengfeng311 use this after retrieving the image. It will kill the workers and free up the memory. In some cases, the memory usage will is high due to the encoder's workers, but the code above will free up that memory and the browser will not crash!
Thanks for reply, but which not solve my problem, I terminate webworker after loaded all images, but when i switch image with cornerstone.loadImage, memory still raise 2%. Do you have any way to solve this problem? @nyacoub
Might need to use chrome memory profiler to take a look
Hello @dannyrb you seem most active on this problem, after several days of debugging I too am having issues loading Multiframe Ultrasound data. I have compiled a list of related issues from this repo at the bottom.
In my case I have RGB encoded, 400mb, 204 frame Ultrasound data in a single multiframe DCM file with transfer syntax 1.2.840.10008.1.2.1
Config:
A few observations:
Conclusions/Deductions from above observations
What does a solution look like:
Related issues
235
425
411
https://github.com/cornerstonejs/cornerstoneWADOImageLoader/issues/156#issuecomment-794628050 https://github.com/cornerstonejs/cornerstoneWADOImageLoader/issues/428
373
https://github.com/cornerstonejs/cornerstone/issues/576 https://github.com/cornerstonejs/cornerstone/issues/519