Hops running on headless Grasshopper instances - Problem with Memory

Hey @romio82 I did look a little more at your code. I’m not much closer to figuring out why Hops is retaining so much memory, however, I did modify your SolveGrasshopper function to look like this:

public static void SolveGrasshopper(string grasshopperFilePath)
{
    var io = new GH_DocumentIO();
    if (System.IO.File.Exists(grasshopperFilePath))
    {
        io.Open(grasshopperFilePath);
       var ghFile = io.Document;
       if (ghFile == null) return;

       Result rc = Result.Success;
       using (ghFile)
       {
           var script = new GH_RhinoScriptInterface();
           rc = script.RunAsCommand(ghFile, null, RhinoDoc.ActiveDoc, RunMode.Scripted);
        }
        RhinoDoc.ActiveDoc.Views.Redraw();
    }
}

Like I said, I don’t think this fixes your issue, but I think this is closer to how you might script Rhino to solve a Grasshopper player (similarly to the GrasshopperPlayer command).
Also, simply for documentation sake, I’ve attached a screenshot of the memory usage while running the GHInRhinoSync command. You can see there’s a steady increase in memory usage while it’s calculating each iteration. However, once I closed the rhino.compute console, that memory is freed up again. Perhaps @stevebaer has some insight here.
Memory