Linked Questions
24 questions linked to/from Limit memory usage for a single Linux process
44
votes
7
answers
72k
views
Is there a way to limit the amount of memory a particular process can use in Unix? [duplicate]
I need to test a process for memory management.
I do not have the source, so I need to do all the testing from the OS side.
I want to be able to say something like limitmemory 400k -p <pid>
Is ...
14
votes
2
answers
38k
views
How to limit available virtual memory per process [duplicate]
Occasionally some processes on my GNU/Linux desktop (such as gv and gnash) use up the physical memory and cause thrashing. Since these processes aren't important, I want them to be automatically ...
2
votes
1
answer
1k
views
Memory Usage in Linux [duplicate]
How to setup limit for process to memory usage?
Similar to open files limit in /etc/security/limits.conf:
ubuntu soft nofile 4096
ubuntu hard nofile 8192
...
1
vote
1
answer
657
views
Restricting CPU memory usage for services to prevent a crash [duplicate]
I'm running a Ubuntu VM with an 8 GB RAM with docker containers ( 8 GB is just about enough for my requirements) but at some point the VM freezes/crashes due to memory exhaustion leaving me no choice ...
1
vote
0
answers
304
views
Set memory allocation for applications in Ubuntu [duplicate]
I have an application running under Ubuntu that tries to consume all available memory. Is there a way to specify and restrict the allocations available for a given application?
0
votes
0
answers
79
views
Execute command with memory constrains [duplicate]
I routinely perform numerical computations in my laptop, using programs that I write myself in Python, Julia, C++, etc. I am not a perfect programmer (far from it), and I make coding errors frequently....
30
votes
4
answers
10k
views
bash -e exits when let or expr evaluates to 0
I have a bash script that sets -e so the script will exit on any exit status != 0.
I'm trying to do some basic shell arithmetic assigned to variables and sometimes the expression equals 0 which ...
24
votes
3
answers
14k
views
How to limit the total resources (memory) of a process and its children
There are plenty of questions and answers about constraining the resources of a single process, e.g. RLIMIT_AS can be used to constrain the maximum memory allocated by a process that can be seen as ...
17
votes
1
answer
6k
views
Does 'ulimit -m' not work on (modern) Linux?
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 ...
10
votes
2
answers
12k
views
What does `swapaccount=1` in GRUB_CMDLINE_LINUX_DEFAULT do?
In the question Limit memory usage for a single Linux process it was mentioned to change the file /etc/default/grub so that GRUB_CMDLINE_LINUX_DEFAULT contains
GRUB_CMDLINE_LINUX_DEFAULT="...
14
votes
1
answer
10k
views
SSH server always available under heavy load
Is there a way my SSH server, and everything under it (including bash) can be always available under heavy load ?
Maybe it could be some kind of a critical path, all in memory, with a dedicated CPU ...
8
votes
1
answer
7k
views
Is setting ulimit -v sufficient to avoid memory leak
We have a process that in recent weeks had a once-off memory leak that resulted in it consuming all memory on our RHEL 7 box
We now wish to set limits around this such that it will never take any ...
10
votes
2
answers
3k
views
How to solve this memory issue gracefully?
I have a standard Linux (Debian testing) laptop, with a swap partition.
I do a lot of experiments with it. Some of them are really memory hungry and the way Linux behaves by default is an issue for ...
5
votes
1
answer
6k
views
Is there a way to set a hard cap/limit on how much RAM Chrome can use?
I'm using Linux on my Steam Deck (SteamOS/Arch Linux).
Is there a method to set a hard cap/limit on the maximum total RAM Chrome can use with command line arguments? (to 8 GB out of the device's max ...
4
votes
1
answer
3k
views
memory.memsw.limit_in_bytes: Invalid argument
I have a Debian 10 server and I am trying to limit the memory + swap of a user using cgroups2.
Using memory.limit_in_bytes works fine, but I want to limit the memory+swap using memory.memsw....