Issue #2403Opened November 12, 2019by varadero0 reactions

editor.load possibly causes memory leak

Question

How to reproduce:

  • Naviagate to https://grapesjs.com/demo.html
  • Open browser console (Chrome) and type the following: setInterval(() => editor.load(), 1000) and press Enter
  • Go to "Memory" tab (Chrome) and look at the memory usage

What happens: The memory is constantly increasing. If you open Chrome's "Performance monitor" you can also see "DOM nodes" and "JS event listeners" constantly increasing. After about 3 minutes "JS Heap size" increases from 24MB to 1000MB, "JS event listeners" increases from about 1600 to 50000+, "DOM nodes" from 8600 to 100000+. After some time the browser tab will crash because of the high memory consumption.

The same happens also if you have very simple grapesjs project and place a single block in the canvas and start in an interval a call to editor.load().

Answers (3)

varaderoNovember 15, 20190 reactions

This is important. If not fixed, it makes GrapesJS dangerous to use especially in SPA applications.

artfNovember 18, 20190 reactions

I'll check it out, but any help is welcome

diazemilianoSeptember 3, 20200 reactions

I'm having the same issue here. Even after destroy the editor, the issue remains.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.