Open novakoki opened 5 years ago
Thanks for the report, @novakoki. FWIW, as a temporary workaround, we've been able to free up space by periodically killing workers (after processing X tasks), or when the task queue gets low.
This issue will likely end up in a web-worker + memory improvement round up as we clean up these issues.
Here are some memory snapshots below:
cornerstoneWADOImageLoader live example with a single instance of compressed dicom file compressed size: about 300KB (Uint8Array) uncompressed size: about 512KB (UInt16Array) We can also find the two ArrayBuffer use different memory addresses.
A series of dicom instances, compressed, with cornerstoneWADOImageLoader@2.1.4, using web worker instance size: 191 ideal memory utilization: 191 512KB ~ 95MB actual memory utilization: 191 512KB (uncompressed) + 191 * 300KB (compressed) ~ 150MB
The same series above, but with cornerstoneWADOImageLoader@0.13.3, the last version without web worker We can also find the two ArrayBuffer use the same memory address.
And if the original dicom file is uncompressed, it cost double size of all instances.
In my opinion, web worker or codecs may be the key point, but I could not find where the problem is in source code.