alter kma.c to record average malloc and free times