giu: [bug] codeeditor memory consumption
What happend?
Tried to make a tab system using multiple editors works fine!
The issue comes when you out in alot of text into these editors. If i out in around 13k lines, I can watch as my memory usage slowly increases into the 10s of gbs
Code example
main.go
// put your code here!
To Reproduce
- Run my demo
- will see the crash…
Version
master
OS
Windows 11
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (1 by maintainers)
Commits related to this issue
- deps: upgrade cimgui-go fix #968 — committed to gucio321/giu by gucio321 2 years ago
again, on the demo you sent me, it has 0 problems rendering and displaying this text, and it also doesnt slow down the applications fps (if i have this amt of text in the golang version, dragging is slow. on the normal c++ demo you sent me, it handles it perfectly, no memory increases nor fps drops)
again, unsure whats causing this exactly. but im glad i can help out a little
It’s reasonable to provide a mechanism to disable auto string registration, it will increase the complexity but provides possibility for some corner case like this.
This would increase CPU usage but not memory because the map is cleared every frame (and generally is managed by go so GC is here). btw @AllenDang what do you think about reworking FontAtlas a bit? I think there should be a possibility to disable auto registration for strings (because iterating over 13k lines of code could be a bit heavy) and rather allow user register characters once.
I’d rather say cimgui-go problem 😉 but yes its deffinitly something in our wrapper.
I’ve checked and ImGuiColorTextEdit.CodeEditor.Text() is a problem.
Of course, I can try it when I get home ^^