Function to print memory dump