Performance improvements, added memory allocation monitoring