In EasyEffects(and PulseEffects) I use --gappplication-service to keep the application running in background once its window is closed. It works but when the window is closed I never see a decrease in the memory used by the application(measured in gnome system monitor). It does not seem that there is a leak. If I close and open the window multiple times the memory usage is essentially the same within some small fluctuation. It is almost like gtk is caching something related to the widgets. Is there something special that has to be done when using --gapplication-service or is this the way gtk3/gtk4 handles memory?
In case anyone wants to see this is how I create and destroy the window https://github.com/wwmm/easyeffects/blob/f76cf2bee9032c4759a3db6e13dfffac90fea9d3/src/application.cpp#L276