Linux memory consumption
-
Hi,
I've been playing around with HISE and Linux in combination for the last few days. So far everything works great. But I noticed a pretty big memory consumption. After opening an almost empty project, about 1.5GB are used for fonts. I think that in the "LinuxFontManager" something is not working with the caching. As far as I understand it, the "API" list on the left is the cause. I couldn't test other operating systems yet, because I don't know a good alternative to heaptrack on macOS and Windows.
Test system:
- Fedora 38
- gcc-13
- Release build
-
@tobante Yeah theLinux font manager causes HISE to run really slow as well. I just disable it but it would be nice to have a fix.
-
@d-healey It's still usable, I have 64GB, so that's not the issue, but 70'000 calls to
Typeface::createSystemTypefaceFor
seems like a logic error to me. :) -
@tobante Try using scriptnode there is a thread about this issue somewhere, might be worth digging it up.
-
@d-healey I think I just found the issue. The
SharedResourcePointer
for theLinuxFontManager
gets initialized each time theLinuxFontHandler::Instance
is requested. So there are 70000 instances of the "global" font manager.// hi_tools/Macros.h:212 #define GLOBAL_FONT() (LinuxFontHandler::Instance().getGlobalFont())
Maybe just make the font manager a static singleton
-
@tobante Yup, here's the thread - https://forum.hise.audio/topic/3893/custom-workspace-slow-hise
-
@d-healey Ok, so we need a way to have a static object without crashing the leak-detector and/or pluginval. There must be a way, there are other static objects in JUCE itself. I wonder how the
ImageCache
class does things.