add monitor to print out memory usage