Merge memory checking functionality from sandbox

Change-Id: I304c789a752c9f4af4944ca14b9bf1e7644da15a
5 files changed