Revit Slows down after large Dynamo script

I usually try to break scripts up into smaller pieces to limit script complexity and the size of the data set.

After running scripts, I run a script called “_RELEASE RAM” which is comprised of two nodes.

A Code block with the number “2” and an addition block which adds 2 + 2.

The first run from the dynamo player can take anywhere from 2-10 seconds. The second run takes maybe 0.5 seconds. This seems to get Revit back up to speed, but I don’t know that it completely clears the RAM…

I also have an issue on some machines where Dynamo itself becomes unusable when searching for nodes after running just average sized graphs. It has something to do with the Ethernet, but that is a completely different issue.