Implemented memory allocation counter