cornerstoneWADOImageLoader icon indicating copy to clipboard operation
cornerstoneWADOImageLoader copied to clipboard

Out of memory when loading CharLS/JP2K images on iOS

Open Ouwen opened this issue 2 years ago • 3 comments

It seems that iOS safari/chrome is has memory issues when loading both JPEG2000 and CharLS codecs. This might be related to #410.

The behavior is a bit unstable and sometimes does work. When it fails a generic "Range Error: Out of Memory" is thrown and requires safari force quitting to reload.

To reproduce on iOS, connect iPhone via the safari web debugger. Add host: '0.0.0.0' after the port: 3001 in webpack.

Open up the wadouri example and load a CharLS image then a JPEG2000 image. JPEG2000 should fail. Refresh and load a JPEG2000 image then a CharLS image. CharLS should fail.

Ouwen avatar Jan 14 '23 09:01 Ouwen

Updating to latest CharLS 1.2.1 seems to fix the memory problem on iOS likely due to the 50mb per codec memory change.

CharLS 1.2.1 is slower in desktop chrome browser, compared to older version. CharLS 1.2.1 is quite performant on safari browser.

@sedghi do you know why this might be the case?

Ouwen avatar Jan 14 '23 23:01 Ouwen

Hmm, I had plan this week to revisit this on WADO side to update all codecs to new one that I published recently.

How much worst is it in desktop chrome browser? and how did you benchmark?

sedghi avatar Jan 16 '23 02:01 sedghi

For chrome, it is visibly worse but I didn’t formally benchmark. However, safari is able to run at around the speed of previous.

Ouwen avatar Jan 16 '23 13:01 Ouwen