You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a large image (about 4000x4000) and using any image adjustment node on it and play around for a small amount of time with its parameters, wasm dies of oom.
A small round of debugging showed me, the last allocation before the exception is always an TaggedValue::ImageFrame.
I've just done some Drop and static AtomicUsize magic and counted all instances of ImageFrame that are instanciated. I hope, I've implemented it correctly. When creating a new document, this count is at about 31 (varying from times to times). When pasting my image, this number grows to 34. When creating a blend node, it gets 36. When inserting the node into the graph, it gets about 49. And when playing around with the parameters, it goes up and down (not under 49) and crashes when it gets >60.
Some quick maths: an 4000x4000 image with 4 f32 channels has 4000 * 4000 * 4 * 4 Bytes = ca 244MiB. Assuming a maximum memory size of 4GiB, it needs only 17 copies of this image to overflow memory.
Activity
nat-rix commentedon May 21, 2023
I've just done some
Dropandstatic AtomicUsizemagic and counted all instances ofImageFramethat are instanciated. I hope, I've implemented it correctly. When creating a new document, this count is at about 31 (varying from times to times). When pasting my image, this number grows to 34. When creating a blend node, it gets 36. When inserting the node into the graph, it gets about 49. And when playing around with the parameters, it goes up and down (not under 49) and crashes when it gets >60.Some quick maths: an 4000x4000 image with 4 f32 channels has
4000 * 4000 * 4 * 4 Bytes = ca 244MiB. Assuming a maximum memory size of 4GiB, it needs only 17 copies of this image to overflow memory.Keavon commentedon May 21, 2023
(Our wasm memory is only 2GB since wasm-bindgen has a bug that uses signed pointer values which wastes half the 4GB)
Keavon commentedon Apr 11, 2025
Consolidating this into #1895.