memtst: report the total memory allocated

It also reports the maximum amount of memory in use during the
execution of a program.