1

I'm programming stuff on Python with Pycharm, and sometimes run regressions using Stata.

Sometimes, I need these applications to use as much as memory as they can get to speed up computations/

Sometimes, through nobody's fault but my own, these applications explode in memory. Perhaps a case I didn't think about, some inefficiency in algorythms, there are multiple ways this can happen.

I would like to guarantee these applications as much memory as possible, but prevent them from taking "core applications" memory. That is, I don't want my general Ubuntu GUI (great if this works for Elementary OS, too) to be slowed down because it has to be loaded into memory again.

Is there a way to ensure that a certain set of applications always precede in memory, if they are running? I mostly care about core applications and GUI, but it would be great if I could add custom applications such as Kupfer to the list.

FooBar
  • 643
  • @AndroidDev Notice that I am looking for the opposite: I don't want to set an upper bar for Python/Stata, they're supposed to be able to greedily take all available memory. Memory assigned to a certain sets of applications however should not be defined as "available" to them. – FooBar Jul 03 '17 at 12:12
  • For example, say I'd think that 1GB is sufficient for OS, Kupfer, Guake etc. Then I could assign $max - 1 to Python. But what if Chrome is running at the same time, and then for some reason Chrome has precedence over Guake? Python would grab $max - 1, push out memory for core routines, and Chrome would stick to its memory. – FooBar Jul 03 '17 at 12:14
  • Uh, a program can't eat memory allocated to another program.... The danger is when Python eats all the available memory, the UI/core processes can't take any more if they need it, and then you have a freeze until the kernel hard-kills Python because it's the biggest offender. – You'reAGitForNotUsingGit Jul 03 '17 at 12:15
  • Yes, that's what I meant but sloppily described. – FooBar Jul 03 '17 at 12:16
  • So basically you want the memory allocated to Python to dynamically change based on how much memory your userspace applications are using? – You'reAGitForNotUsingGit Jul 03 '17 at 12:17
  • 1
    https://serverfault.com/questions/284075/reserve-lock-memory-for-ssh-on-ubuntu – muru Jul 03 '17 at 15:02

0 Answers0