Ionaru / easy-markdown-editor

EasyMDE: A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
https://stackblitz.com/edit/easymde
MIT License
2.31k stars 308 forks source link

Memory leak with previewImagesInEditor #579

Closed p1gp1g closed 1 month ago

p1gp1g commented 5 months ago

Describe the bug There is a memory leak if the textarea contains many images (like 20+) with previewImagesInEditor = true. The application's memory usage amounts to GB and is constantly increasing.

This has been tested with Firefox on Windows and Linux.

To Reproduce I've attached an example, which is the demo with some images and previewImagesInEditor = true. The images come from https://fr.wikipedia.org/wiki/Chat.

Steps to reproduce the behavior:

  1. Download and unzip poc.zip
  2. Open a simple http server where the files were extracted
  3. Open about:processes with Firefox to see the memory consumption
  4. Open the http server webpage with Firefox
  5. See the memory usage increasing
  6. Close the webpage if you don't want your browser being killed out of memory

Version information