Add memory usage and max usage stats. Upstream-commit: 3c5bac034862568f92e7bc5c7b8e4b313aea2b29 Component: engine