Given a specific resource constraint like limited RAM, how would you optimize a basic data sorting algorithm for Dover India embedded systems?