View previous topic :: View next topic |
Author |
Message |
creiss Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/20463702884a9d8c94371aa.jpg)
Joined: 21 Sep 2006 Posts: 102 Location: Dortmund
|
Posted: Sun Sep 30, 2007 4:48 pm Post subject: [solved] Limit memory for a process |
|
|
Hey all!
How would I be able to limit the total amount of memory one process might use? I am not talking about a general max size, but more of a "this process". I have one issue with a programm that like to memory leak and bugs my system down until i can only hit the reset switch.
Any help would be very welcome,
-Chris. _________________ Registered Linux User #38359 (http://counter.li.org)
Last edited by creiss on Sun Oct 14, 2007 6:13 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Dottout l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/27792370046320ed1a536e.jpg)
Joined: 07 Mar 2006 Posts: 882
|
Posted: Sun Sep 30, 2007 5:07 pm Post subject: |
|
|
ulimit should do the trick |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
creiss Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/20463702884a9d8c94371aa.jpg)
Joined: 21 Sep 2006 Posts: 102 Location: Dortmund
|
Posted: Sun Sep 30, 2007 5:09 pm Post subject: |
|
|
That was fast.
Could you maybe also supply me with a possible use? The manpage is not that obvious on that.
Thanks!
-Chris. _________________ Registered Linux User #38359 (http://counter.li.org) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Dottout l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/27792370046320ed1a536e.jpg)
Joined: 07 Mar 2006 Posts: 882
|
Posted: Sun Sep 30, 2007 5:12 pm Post subject: |
|
|
sorry but I've never used it :p |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hu Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
Joined: 06 Mar 2007 Posts: 23089
|
Posted: Sun Sep 30, 2007 7:22 pm Post subject: |
|
|
The ulimit manpage is probably not the documentation you want to read for this. Bash has a built-in command called ulimit which can do what you want, and is probably what Dottout was referencing. See info bash and search for ulimit in the info pages. Run ulimit -a to see all current limits.
If you are not using bash, the command to control resource limits may be named differently. In that case, tell us what shell you are using and we can help you find the command for that shell. The support is provided by the kernel, so you can apply resource limits regardless of which shell you use. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
creiss Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/20463702884a9d8c94371aa.jpg)
Joined: 21 Sep 2006 Posts: 102 Location: Dortmund
|
Posted: Sun Sep 30, 2007 7:29 pm Post subject: |
|
|
Hey,
Thanks for your kind reply.
I am using bash allright.
-Chris. _________________ Registered Linux User #38359 (http://counter.li.org) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Emopig Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/121865118344ca4ae08fc83.png)
Joined: 15 Mar 2006 Posts: 188
|
Posted: Mon Oct 01, 2007 10:00 am Post subject: |
|
|
Pay special attention to what happens when the memory limit is reached. Most programs aren't coded to respond well to out of memory errors when they try and allocate. _________________ 2.6.35 / Gnome 2.30
Athlon64 3500+ / 1.5 GB / Asus A8N VM CSM |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
creiss Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/20463702884a9d8c94371aa.jpg)
Joined: 21 Sep 2006 Posts: 102 Location: Dortmund
|
Posted: Mon Oct 01, 2007 10:16 am Post subject: |
|
|
Anything is better than stalling the system. Let it dump, fault... anything!
-Chris. _________________ Registered Linux User #38359 (http://counter.li.org) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|