I'm struggling with a memory clean up/possible memory leak problem. Calling simple code like
ring r = ...;
ideal i = ...;
builds up (variable) memory (I'm checking memory(0) and also direct system output coincides with this observation), although I would expect that after "kill r" everything is cleaned up (there are no further variables and processes defined). I realized it since I'm calling code like that a lot of times inside the same (c++) session. It seems to me that memory is lost whenever something is printed (output and info/warning messages). My question though is two-fold:
Is this actually a bug in the code or I'm I forgetting to clean up something? I'm mainly interested to have this properly working through the c++ interface. (I'm using interpreter functions directly from within c++, like iiAllStart), the same memory loss happens also happens when called from the singular binary.
Or is there a way to reset the whole interpreter environment from within c++ without a full restart?
(If you're interested: I'm actually building a simple Singular interface for Mathematica via its LibraryLink function to have fast interaction with Singular. Everything except from this memory problem works like a beauty.)