[bugs:#2506] Dedicated GPU memory isn't cleaned up when Scintilla instances are destroyed
Status: open
Group: Bug
Labels: scintilla Memory Leak gpu DirectWrite
Created: Tue Mar 31, 2026 08:42 PM UTC by Joseph Betz
Last Updated: Tue Mar 31, 2026 08:42 PM UTC
Owner: nobody
Attachments:
Creating multiple instances of Scintilla in an application results in a leak of GPU memory. Each time a new instance is created, GPU memory is allocated, and it is never cleaned up when the associated window is destroyed.
This is observable on Windows 10 using the Details tab of the Task Manager with the Dedicated GPU memory column visible.
As I workaround, I disabled DirectWrite, so no additional GPU memory is allocated when new instances are created. However, it does not clean up memory claimed by existing instances.
I ran into this while using the Dolphin Smalltalk IDE, which creates a new Scintilla instance each time a text editor is opened rather than creating multiple documents within a single instance. Since this is a nonstandard use of Scintilla, it may be difficult to reproduce with Scite or Notepad++, but a simple script that creates and destroys multiple instances should suffice?
Sent from sourceforge.net because scintill...@googlegroups.com is subscribed to https://sourceforge.net/p/scintilla/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/scintilla/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
Can't see anything obvious in the allocation and deallocation of Direct* resources. They are handled through WRL::ComPtr so should all be released when deleting the ScintillaWin.
The particular technology setting may affect behaviour with Technology::DirectWrite1 being more complex and with newer code.
Sometimes code allocates memory pools which are retained to avoid extra work. Open multiple Scintilla windows then close them and open the same windows again. If there is a similar amount of memory used after the second openings then the use may be of this form.
Sometimes graphics drivers have bugs. The leak should be verified on a machine with a different brand GPU.
Can't see anything obvious in the allocation and deallocation of Direct* resources. They are handled through WRL::ComPtr so should all be released when deleting the ScintillaWin.
Thanks for looking into it.
Sometimes code allocates memory pools which are retained to avoid extra work. Open multiple Scintilla windows then close them and open the same windows again. If there is a similar amount of memory used after the second openings then the use may be of this form.
I don't understand. How do you reopen a window that has already been closed?
Sometimes graphics drivers have bugs. The leak should be verified on a machine with a different brand GPU.
The leak happens on a NVIDIA GeForce GT 1030, driver version 32.0.15.6094. I updated it to v32.0.15.8228 and the behaviour doesn't change. The versions are about two years apart.
In any case, I'll see if I can find other Dolphin users with different hardware to try and reproduce it.
[bugs:#2506] Dedicated GPU memory isn't cleaned up when Scintilla instances are destroyed
Status: open
Group: Bug
Labels: scintilla Memory Leak gpu DirectWrite
Created: Tue Mar 31, 2026 08:42 PM UTC by Joseph Betz
Last Updated: Wed Apr 01, 2026 03:51 AM UTC
Owner: nobody
Attachments: