Integrate the garbage collection mechanism provided by the kernel. This should significantly improve editing performance.