Fixed massive memory usage