What is the practical difference between the soft and hard limit in python's resource?
For example, what would be the difference between doing:
import resource
soft_limit,hard_limit=resource.getrlimit(resource.RLIMIT_DATA)
# set soft limit
resource.setrlimit(resource.RLIMIT_DATA, (1024,hard_limit))
# set soft and hard limit
resource.setrlimit(resource.RLIMIT_DATA, (1024,1024))
And finally, yes I have read the docs for the soft and hard limit and still don't understand in practical terms what the difference is:
Resources usage can be limited using the setrlimit() function described below. Each resource is controlled by a pair of limits: a soft limit and a hard limit. The soft limit is the current limit, and may be lowered or raised by a process over time. The soft limit can never exceed the hard limit. The hard limit can be lowered to any value greater than the soft limit, but not raised. (Only processes with the effective UID of the super-user can raise a hard limit.)