1. A computer-implemented method, the method comprising: responsive to determining that a total memory usage of an application exceeds a predefined threshold, performing the following operations: selecting a set of objects stored in volatile memory that have not been recently used by the application, wherein each object from among the set of object resides at a respective range of memory addresses in the volatile memory and each object was created by the application; setting, in connection with the selecting, memory protection on the respective range of addresses in the volatile memory for each object from among the selected set of objects, wherein the memory protection flags the respective range of addresses for handling when the application subsequently performs a read or write operation to the respective range of addresses; based on memory protection being set on the respective range of addresses, copying the selected set of objects from the volatile memory to a non-volatile memory; and freeing the respective range of memory addresses in the volatile memory for each object from among the selected set of objects.