I'd like some inactive processes to app swap into virtual memory, freeing main memory up for other uses.
I have created a few shell scripts - sleepchrome, sleepfirefox, and sleepsafari to sleep an app when I don't want to quit it, but don't want it hogging CPU or memory. The scripts work to prevent CPU usage - they identify and send a SIGSTOP signal to the relevant processes. (Happy to share the code if there's interest - ask a question.)
But for some reason, MacOS seems to be uninterested in swapping them out to virtual memory: Even when there's significant memory pressure, per Activity Monitor, the processes memory usage doesn't decrease.
Is this a bug in the OS? Seems to be. Is there a solution? Perhaps it would require a modification to the apps themselves or a plug-in? (which would make this more of a stackoverflow question)