Initial memory quota implementation.

Change-Id: I49006b444724dc78bb594775a17bc281c2c1d857