improved GC and fixed some memory leaks

so that we can track the memory a little bit more