U4-10549 - RTE memory usage

Created by Kamil Jakubczak 17 Oct 2017, 06:58:18 Updated by Claus Jensen 12 Dec 2017, 12:24:00

Tags: PR Gold partner

Subtask of: U4-9609

What did you do?

  1. Add plenty of RTE editors in grid content.
  2. Go back and forward few times.
  3. Take a look at your task messenger and see how browser is in flames (I hit 4 GB RAM usage on that tab only).

What did you expect to happen? That memory will not use 4 GB so the app will be still usable.

What actually happened? Browser died as it was using more and more memory.

The more RTEs on page, the faster it happens. It seems that TinyMCE is not destroyed correctly? Also from what we observed is that each TinyMCE adds its own CSS files that are stored in random GUID directory and they are RichTextEditor.css and content.min.css even if the files are the same.


Søren Kottal 28 Nov 2017, 12:19:10

I can recreate in 7.7.6.

To me it seems like TinyMCE is not destroyed at all. Is there any way the editor can subscribe to events like appState.treeState.changed?

Mads Rasmussen 29 Nov 2017, 09:17:22

@Søren.Kottal The first place I would look is in the grid-rte component (https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js#L367) and make sure it cleans up after itself. I am not 100% sure which events TinyMCE has available but when the component is destroyed it should also destroy TinyMCE correctly.

Søren Kottal 29 Nov 2017, 11:20:49

Thanks @madsrasmussen, didn't know there was a directive. That's why I never hit my breakpoints.

I created a PR https://github.com/umbraco/Umbraco-CMS/pull/2337

Shannon Deminick 12 Dec 2017, 11:02:49

Great! I can confirm the code is executed correctly and that the mem usage when browsing tinymce editors doesn't keep increasing. Thanks!

Priority: Normal

Type: Bug

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 7.7.6

Due in version: 7.7.8

Sprint: Sprint 74

Story Points: 1

Cycle: 6