memory profile function added