add code for testing memory usage