How would you build a scalable app that does not drop frames or crash due to memory exhaustion when executing complex tasks?