Skip to content

Out of memory with large images #1231

Closed as duplicate
Closed as duplicate

Description

@nat-rix

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.
image
A small round of debugging showed me, the last allocation before the exception is always an TaggedValue::ImageFrame.

Activity

  1. nat-rix commented on May 21, 2023

    @nat-rix
    ContributorAuthor

    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.

  2. Keavon commented on May 21, 2023

    @Keavon
    Member

    (Our wasm memory is only 2GB since wasm-bindgen has a bug that uses signed pointer values which wastes half the 4GB)

  3. moved this to Available in Task Boardon May 31, 2023
  4. moved this from Always Up for Grabs to Short-Term in Task Boardon May 31, 2023
  5. Keavon commented on Apr 11, 2025

    @Keavon
    Member

    Consolidating this into #1895.

  6. moved this from Short-Term to Completed This Milestone in Task Boardon Apr 11, 2025
  7. removed
    Help WantedExtra attention is needed
    CrashA panic which crashed the editor
    on Apr 11, 2025
  8. removed theissue type on Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions