Skip to content

Konva 9.3.21 Out of Memory #2000

@zaalbarxx

Description

@zaalbarxx

Hello, I am developing an app which makes extensive use of Konva cache mechanism to cache multiple LOD and swap them under the different zoom level to maintain smooth zooming/panning behavior.

Yesterday, during some tests I upgraded the Konva to 9.3.21 and immediately saw that the browser started to crash with an OOM error. After some investigation I realized that it may be due to the implementation of another cache canvas (buffer canvas) which is probably resulting in the canvas memory being so high that it crashes the window.

I am aware that it would happen even without this new buffer canvas if the size of the cached objects would go beyond the certain level, but I was wondering what would be the potential solution to optimize the cached canvases size per group object. Because, right now, as far as I understand there are at least 3 cached canvases per single cache call which all take width * height * pixelRatio in memory, which can lead to memory issues quite fast (we've already encountered some on the IOS where there is a canvas memory limit set on the browser).

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