Optimize memory consumption in App