Added support for collecting memory allocation