I have a complex Mathematica program that runs in a continuous loop and performs certain calculations on data. The program consists of multiple packages each with a number of functions (usually constructed as Modules).
When executed, the program usually takes up around 3 GB of RAM, however, for some reason, the RAM consumption may suddenly increase by another couple of GB. And then another...
Is there a way to build a list (preferably, dynamically updated) of all variable names (down to functions/Modules in Private` namespaces of packages) and corresponding memory consumption?