add manual GC and Phantom SVG reset to eliminate memory issues