Hard and soft limits

Unixes make a further distinction: in reality (under the hood), the resource limit for a given type is not one numberit's two:

  • A value for the hard limit
  • A value for the soft limit

The hard limit is the true maximum; as a regular user, it's impossible to exceed this limit. What if a process attempts this? Simple: it gets killed by the OS.

The soft limit, on the other hand, can be breached: in the case of some resource limits, the process (that exceeds the soft limit) will be sent a signal by the kernel. Think of this as a warning: you're nearing the limit kind of thing. Again, don't worry, we take a deep dive into signaling in Chapter 11, Signaling - Part I, and, Chapter 12, Signaling - Part II. For example, if a process ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.