You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use the assist field like an editor with an assist function. But if the text field has a long lifetime, the memory increases a lot.
I would expect that memory usage falls, if I delete content from field.
I would also expect, that I have a similar memory usage whether I insert the content step by step or insert the whole content via copy/paste. (if I insert a lot of content via copy/paste the memory usage is very low).
Actual Behavior
I tried to profile the field. Here are my results:
Memory usage is low at the beginning:
Start writing text with stylings and create an initial heap dump (after performing garbage collection)
Write more text with stylings
After manual triggering of garbage collector. Memory is very high
New heap dump in comparison with the last one
Clear text
Create new heap dump after garbage collection and compare to last one
Memory usage remains high
With each change of text field I wand to reparse the field and update the stylings. But it seems like old stylings are never cleaned up.
I tried to use another Undomanager. Because I just need text-changes in UndoManager. I can recreate the stylings with the text parsing. But even with such a simple UndoManger the memory increases a lot.
It's possible to use dispose. But during life time of the component it is hard to find a good trigger point for recreation. Also redo/undo is lost with this workaround.
Expected Behavior
I want to use the assist field like an editor with an assist function. But if the text field has a long lifetime, the memory increases a lot.
I would expect that memory usage falls, if I delete content from field.
I would also expect, that I have a similar memory usage whether I insert the content step by step or insert the whole content via copy/paste. (if I insert a lot of content via copy/paste the memory usage is very low).
Actual Behavior
I tried to profile the field. Here are my results:
With each change of text field I wand to reparse the field and update the stylings. But it seems like old stylings are never cleaned up.
I tried to use another Undomanager. Because I just need text-changes in UndoManager. I can recreate the stylings with the text parsing. But even with such a simple UndoManger the memory increases a lot.
Reproducible Demo
Here is my demo code.
richtexttest.zip
Environment info:
Current Workarounds
It's possible to use dispose. But during life time of the component it is hard to find a good trigger point for recreation. Also redo/undo is lost with this workaround.