1. Fix the size of the memory when releasing. 2. Make sure we only count the device memory Change-Id: Ib4dcda79f313c4ee9cc1c7bab53f8076bce5f583