Ok I'm not sure if this is the correct place to post this. It is more of a 'why not' question than a 'how to' one (assumption is that it isn't/can't be done).

Why don't we allow RAM to be partitioned into 2 (or more) blocks that can be used for separate types of processes? The main motivation here is from being near to 100% used RAM, and freezes happen while (I assume) RAM is swapped onto the disk. Most of the time, this is due to some memory leak and fixed by killing and restarting the process. This can be done in a few commands, but you have to wait until the machine becomes 'unstuck'. If there was some notion of partitioned RAM, you could have a priority set up, e.g. system/util + non-system(with overflow allowing for system RAM) partitions. Then instead on a 'freeze' (application memory leak), you could easily fix the problem.

With my rusty knowledge of memory architecture, you would not need to change much (or anything) on hardware, instead paging/virtual memory could be extended in software to support an additional flag and a coordination manager.

There is clearly an issue with the above, either technically or just not practical. I am just interested in WHY not.

  • 2
    ulimits, and the various forms of virtualization and resource limitations (cgroups/zones/domains/whatever) address this sort of issue (and more). – Mat Jan 7 '15 at 16:50
  • edit I only read up on ulimits so the following may not be correct..... Yes but isn't that for just single processes/threads? I agree it would help for individual runaway processes, not groups of them. I would not care if 70-80% of RAM is hogged by a particular process. I am only worried if many applications try to hog RAM. e.g. Firefox, Eclipse, Matlab all open and competing for RAM, if I set a limit of 30% each, then the cases where I only have firefox open, it suffers as there is more potential RAM available – Andrew Leeming Jan 7 '15 at 17:08
  • You're dealing with an intractable problem. Think of your RAM as a budget. You have 10$ (~Gb). If you start Firefox (3$), Eclipse (3$), Matlab (3$), you're in budget. If any of those asks for 2$ extra for some fancy feature, you're out of budget and need to make a choice. Swapping enables you to borrow some cash, but comes with a cost. If you're constantly hitting swap, you simply don't have enough RAM for the apps you want to use. – Mat Jan 7 '15 at 17:56
  • I am pretty sure that ulimits can be set on process-groups, users etc. – ctrl-alt-delor Jan 7 '15 at 19:21
  • As @Mat said. If one of the processes in the group takes the last penny then you need to know what you should do. Will you just deny the penny to that process (probably causing it to die), will you kill all processes in the group. Will you kill a random member of the group, etc. – ctrl-alt-delor Jan 7 '15 at 19:24

Your Answer

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

Browse other questions tagged or ask your own question.