3 ms·
> I use https://lib.rs/cap https://lib.rs/cap which self-imposes memory limit on the process. How do you choose that limit?
by creata 5y ago
> I use https://lib.rs/cap https://lib.rs/cap which self-imposes memory limit on the process.
How do you choose that limit?
- pornel 5y agoIn case of servers/vm/containers you probably know how much RAM you've provisioned, so set it to that minus whatever other processes need to live. For desktop applications it's tough. It may be just an arbitrarily high amount you don't expect to hit during normal operation. If you need to work with variable-size data, then it could be `size_of_file_being_opened * x` if you can predict the `x`.