previously it kept all seen code in memory, leading to high memory usage by the end of state restoration