Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 933053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:46:09+00:00 2026-05-15T20:46:09+00:00

I would like to limit the amount of physical memory a process can use

  • 0

I would like to limit the amount of physical memory a process can use without limiting the amount of virtual memory it can use. I am doing this in an effort to measure the behavior of various algorithms under memory pressure, and I need to test their performance with many different amounts of physical memory available – so I either need to buy a crapton of memory in lots of obscure sizes, or I need an operating system which supports limiting resident memory of a process in some way.

Unfortunately, Linux doesn’t respect/enforce setrlimit(RLIMIT_RSS, ...), and neither does OSX.[1] Could you recommend me an operating system that CAN do this? Any of the non-OSX BSDs? Is there a mechanism to do this in Solaris? Can some variant of Windows do this?


[1] Linux ignores the request entirely, and OSX only uses it to decide what to swap out first when physical memory is exhausted. Neither of which helps me analyze the behavior of an algorithm when only X Megs of memory are available for use. It turns out Linux doesn’t have any mechanism for doing this in the kernel, so it’s pretty much out entirely unless someone can point me to a kernel fork which enables this. Solaris doesn’t even have that option to setrlimit(), but it may have another way that I don’t know about.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T20:46:10+00:00Added an answer on May 15, 2026 at 8:46 pm

    Figured it out. So, you pretty much can’t do this with any Unix I could find.

    Therefore, the thing to do is to run a virtualized OS which has as much memory as you want to give it. Then, the virtual OS will get driven into swap, but your main OS will hum along just fine. Even better, if you want to just count page faults rather than measure wall-clock time, with this approach you can make the swap disk for the virtual machine a ramdisk of the unvirtualized one – thus making page faults take almost no time to resolve in the virtualized machine!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to limit all user searches by 65,000 rows. This change should
I'm creating a login script. In this script, I would like to limit the
I would like to limit an application to having only one instance running on
I'm using the TServerSocket component in my Delphi application. I would like to limit
I would like to use a language that I am familiar with - Java,
We are creating a Real-Time Process in VxWorks 6.x, and we would like to
I would like to give customers a random-looking order number but use 0, 1,
I would like to get a sum from a column, with and without a
I would like to remove/delete a migration file. How would I go about doing
(please excuse that I didn't use aliases). I would like my query output to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.