Build technology that is acutely aware of its own limitations. How much memory does this program have access to left? How much power is this computer receiving? Will it run out of battery soon? Can we still serve this website?
Data like this can be presented to end users of the software - if broadcast over a server kind of system - or can provide immediate feedback to the computer - say, a scheduler - to decide what tasks to run when if there are many batch jobs to run queued in the background in order to optimize resource usage.
The question becomes, then, how to ensure all of this reading is done in a performant fashion and whether it's worthwhile to evaluate processes based on their resource consumption rather than performing some random OOM killing nonsense to preserve the device.
The best way to handle this really depends on the computer, but it's very clear that we can't morally build technology - or, specifically, write code - without acknowledging its resource consumption.