10

This article claims that the -m flag to ulimit does nothing in modern Linux. I can find nothing else to corroborate this claim. Is it accurate?

You may try to limit the memory usage of a process by setting the maximum resident set size (ulimit -m). This has no effect on Linux. man setrlimit says it used to work only in ancient versions. You should limit the maximum amount of virtual memory (ulimit -v) instead.

If it's true that it worked in older versions of Linux, which version stopped supporting this?

11

It says right there in the article:

This has no effect on Linux. man setrlimit says it used to work only in ancient versions.

The setrlimit man page says:

 RLIMIT_RSS
        Specifies the limit (in pages) of the process's resident set
        (the number of virtual pages resident in RAM).  This limit has
        effect only in Linux 2.4.x, x < 30, and there affects only
        calls to madvise(2) specifying MADV_WILLNEED.

So it stopped working in 2.4.30.

  • Thanks. I looked through the setrlimit page, but didn't know what to look for. – Flimzy May 15 '14 at 21:10
  • You had to look for resident from resident set size. – Cristian Ciupitu May 15 '14 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.