Gamma does not release memory when closing a patch

I see this behavior in 2021.4.10

Steps to reproduce

  1. Open gamma
  2. Open Taskmanager and Observe Gammas Ram usage
  3. Open the Help browser - learn tab - type skia
  4. Open the Drawing primitives Help patch, on my system, Ram usage increase by approx. 5MB
  5. Close the Drawing primitives help patch using ctrl + W, Ram usage does not fall.
  6. repeat steps 4 and 5 and see memory usage rise.

I have seen this with skia patches, but same bahavior can be observed when creating and closing new empty patches, here it is just around 0.3MB

Can anyone else confirm this behavior?

Same here.

Well yes, this is kind of by design. Our system compiles patches into so called .NET assemblies. Such an assembly can’t be unloaded once loaded. Using the task manager to look at the memory usage can also be a little bit misleading, because the garbage collector of .NET might hold on to memory as long as the system is not under high pressure.
I’ve repeated your steps with a memory profiler which shows the “leak” in a more accurate way. The snapshots were taken after closing the help patch. As you can see the actual increase in memory is around 1MB if we simply look at the “dead” and “new” numbers.

Ok, so some times, having open and closed lots of big patches, it would be a good idea to completely restart gamma.

Could these figures somehow be available when patching? Perhaps even an option of seeing how much memory would be released by completely restarting gamma. That could be a handy number to have an eye on, especially if you are close to the ram limits of the system

1 Like

I did found something weird a few days ago , maybe the explanation of Elias might be the reason…

Leave a document on your desktop
open that document with gamma, close it, create a new document , be sure to have that only document open, closet again, at this point you will have a “clear” instance of gamma, without any open document
try to erase the document from the desktop.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.