more accurate memory peak evaluation