Skip to main content
fixed a typo, improved grammar
Source Link
HalosGhost
  • 4.9k
  • 10
  • 37
  • 42

So I have 4 GB RAM + 4GB swap. I want to create a user with limited ram and swap: 3 GB RAM and 1 GB swap. Is such thing possible? Is it possible to start applications with limited RAM and swap avaliable to them without creating a separate user (and not installing any special apps - having just a default Debian/CentOS server configuration, and not using sudo)?

Update:

So I opened terminall and typed into it ulimit command: ulimit -v 1000000 which shall be like 976,6Mb limitation. Next I called ulimit -a and saw that limitation is "on". Then I started some bash script that compiles and starts my app in nohup, a long one nohup ./cloud-updater-linux.sh >& /dev/null &... but after some time I saw:

enter image description here

(which would be ok if no limitations were applied - it downloaded some large lib, and started to compile it.)

But I thought I applied limitations to the shell and all processes launched with/from it with ulimit -v 1000000? What gotdid I get wrong? How to make a terminal and all sub processes it launches be limited on ram usage?

So I have 4 GB RAM + 4GB swap. I want to create a user with limited ram and swap: 3 GB RAM and 1 GB swap. Is such thing possible? Is it possible to start applications with limited RAM and swap avaliable to them without creating a separate user (and not installing any special apps - having just a default Debian/CentOS server configuration, and not using sudo)?

Update:

So I opened terminall and typed into it ulimit command: ulimit -v 1000000 which shall be like 976,6Mb limitation. Next I called ulimit -a and saw that limitation is "on". Then I started some bash script that compiles and starts my app in nohup, a long one nohup ./cloud-updater-linux.sh >& /dev/null &... but after some time I saw:

enter image description here

(which would be ok if no limitations were applied - it downloaded some large lib, and started to compile it.)

But I thought I applied limitations to the shell and all processes launched with/from it with ulimit -v 1000000? What got I wrong? How to make a terminal and all sub processes it launches be limited on ram usage?

So I have 4 GB RAM + 4GB swap. I want to create a user with limited ram and swap: 3 GB RAM and 1 GB swap. Is such thing possible? Is it possible to start applications with limited RAM and swap avaliable to them without creating a separate user (and not installing any special apps - having just a default Debian/CentOS server configuration, and not using sudo)?

Update:

So I opened terminall and typed into it ulimit command: ulimit -v 1000000 which shall be like 976,6Mb limitation. Next I called ulimit -a and saw that limitation is "on". Then I started some bash script that compiles and starts my app in nohup, a long one nohup ./cloud-updater-linux.sh >& /dev/null &... but after some time I saw:

enter image description here

(which would be ok if no limitations were applied - it downloaded some large lib, and started to compile it.)

But I thought I applied limitations to the shell and all processes launched with/from it with ulimit -v 1000000? What did I get wrong? How to make a terminal and all sub processes it launches be limited on ram usage?

So I have 4 GB RAM + 4GB swap. I want to create a user with limited ram and swap: 3 GB RAM and 1 GB swap. Is such thing possible? Is it possible to start applications with limited RAM and swap avaliable to them without creating a separate user (and not installing any special apps - having just a default Debian/CentOS server configuration, and not using sudo)?

Update:

So I opened terminall and typed into it ulimit command: ulimit -v 1000000 which shall be like 976,6Mb limitation. Next I called ulimit -a and saw that limitation is "on". Then I started some bash script that compiles and starts my app in nohup, a long one nohup ./cloud-updater-linux.sh >& /dev/null &... but after some time I saw:

enter image description here

(which would be ok if no limitations were applied - it downloaded some large lib, and started to compile it.)

But I thought I applied limitations to shallthe shell and all processes launched with/from it with ulimit -v 1000000? What I got I wrong? How to make a terminal and all sub processes it launches be limited on ram usage?

So I have 4 GB RAM + 4GB swap. I want to create a user with limited ram and swap: 3 GB RAM and 1 GB swap. Is such thing possible? Is it possible to start applications with limited RAM and swap avaliable to them without creating a separate user (and not installing any special apps - having just a default Debian/CentOS server configuration, and not using sudo)?

Update:

So I opened terminall and typed into it ulimit command: ulimit -v 1000000 which shall be like 976,6Mb limitation. Next I called ulimit -a and saw that limitation is "on". Then I started some bash script that compiles and starts my app in nohup, a long one nohup ./cloud-updater-linux.sh >& /dev/null &... but after some time I saw:

enter image description here

(which would be ok if no limitations were applied - it downloaded some large lib, and started to compile it.)

But I thought I applied limitations to shall and all processes launched with/from it with ulimit -v 1000000? What I got wrong? How to make a terminal and all sub processes it launches be limited on ram usage?

So I have 4 GB RAM + 4GB swap. I want to create a user with limited ram and swap: 3 GB RAM and 1 GB swap. Is such thing possible? Is it possible to start applications with limited RAM and swap avaliable to them without creating a separate user (and not installing any special apps - having just a default Debian/CentOS server configuration, and not using sudo)?

Update:

So I opened terminall and typed into it ulimit command: ulimit -v 1000000 which shall be like 976,6Mb limitation. Next I called ulimit -a and saw that limitation is "on". Then I started some bash script that compiles and starts my app in nohup, a long one nohup ./cloud-updater-linux.sh >& /dev/null &... but after some time I saw:

enter image description here

(which would be ok if no limitations were applied - it downloaded some large lib, and started to compile it.)

But I thought I applied limitations to the shell and all processes launched with/from it with ulimit -v 1000000? What got I wrong? How to make a terminal and all sub processes it launches be limited on ram usage?

Tweeted twitter.com/#!/StackUnix/status/181027031109206016
edited tags
Link
Gilles 'SO- stop being evil'
  • 865.4k
  • 205
  • 1.8k
  • 2.3k
added 911 characters in body
Source Link
myWallJSON
  • 1.2k
  • 3
  • 14
  • 22
Loading
Source Link
myWallJSON
  • 1.2k
  • 3
  • 14
  • 22
Loading