My program has a lot of work requiring a lot of memory, which I canโt know exactly when I need to stop it, but in case there is little memory left, I can make it stop using resources. Can I find out how much remaining (in bytes) memory my program can use?
P / s: There is no way to free up process memory. They need memory as much as possible, and this is how it works (and there is no rubbish for the collector, as the old ones are still needed).
source share