I am not the one to tell the reason why gtkdialog uses more resources than a compiled code, but it obviously does. But I find it strange that Pmusic should use 60% of 512Mb RAM. - That is a lot...- maybe the "XML" (sic) file contains a lot of info (complicated UI and data) and ends up using a lot of memory
- maybe gtkdialog uses a lot of memory with some things (or has a memory leak).
Well, that could make perfectly sense. The func_progressbar is not a loop running in the background. It is a function called from the gui each 0.2 sec, and depending on its output, it might not be finished before next call. Most of these calls quits immediately, but some will occupy the system with larger requests. When a new track is started, func_progressbar will update the values of NOW_PLAYING. This require 'ffmpeg -i', and for streams, that could in particular take some time.2) Note how your "ps" output showed multiple instances of func_progressbar. It doesn't make sense that there are multiple progressbar instances at the same time...
Thank you for your input and concern
Sigmund