fix intermittent GC issue discovered in Trace test