I'm developing a program that depending on input, can end up being extremely memory intensive. I want to give users the option of limiting RAM usage, as well as set a limit when memory threshold is passed so program can exit gracefully with an error message.
I found a previous (old) question that suggested a way of doing this in Unix and python 2: How to set memory limit for thread or process in python?
But I haven't found an easy clean way to set this limit for cross-platform, was wondering if anyone came across a cleaner way since then.