The returned information about a function contains the maximum memory consumed. Alternatively, check the memory usage in the execution result.