Skip to content

OutOfMemoryException when repeatedly initializing InkCanvas in UWP #10063

Open
@VishalOmprasad

Description

Describe the bug

In UWP, initializing a new instance of InkCanvas more than 127 times results in an OutOfMemoryException with the message: "Insufficient memory to continue the execution of the program."
Link to public repository (that contains issue reproducible sample): https://github.com/VishalOmprasad/InkCanvas-Issue-UWP.

Steps to reproduce the bug

  1. Create a new UWP project.
  2. Add a Button control.
  3. In the Button.Click event handler, include a for loop to repeatedly initialize new instances of InkCanvas.
  4. Run the app and observe that it crashes with an OutOfMemoryException after initializing InkCanvas more than 127 times.

Expected behavior

The app should not crash with OutOfMemoryException.

Screenshots

No response

NuGet package version

None

Windows version

No response

Additional context

No response

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageIssue needs to be triaged by the area owners

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions