Update flags with memory optimizations

Credit to AOSPAL

Change-Id: Iad7a19fc7d25c2bb2b8bd82efdf368bc0e1de02a