Add explicit GC calls after expensive db ops (ref #468)