move memory-related code to memory module
use consistent calls to getSystemProfilerInfo()

This is needed for properly execution caching by Memoize

Closes: #2076