Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Limit memory for a process
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
creiss
Tux's lil' helper
Tux's lil' helper


Joined: 21 Sep 2006
Posts: 102
Location: Dortmund

PostPosted: Sun Sep 30, 2007 4:48 pm    Post subject: [solved] Limit memory for a process Reply with quote

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
View user's profile Send private message
Dottout
l33t
l33t


Joined: 07 Mar 2006
Posts: 882

PostPosted: Sun Sep 30, 2007 5:07 pm    Post subject: Reply with quote

ulimit should do the trick
Back to top
View user's profile Send private message
creiss
Tux's lil' helper
Tux's lil' helper


Joined: 21 Sep 2006
Posts: 102
Location: Dortmund

PostPosted: Sun Sep 30, 2007 5:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dottout
l33t
l33t


Joined: 07 Mar 2006
Posts: 882

PostPosted: Sun Sep 30, 2007 5:12 pm    Post subject: Reply with quote

sorry but I've never used it :p
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23089

PostPosted: Sun Sep 30, 2007 7:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
creiss
Tux's lil' helper
Tux's lil' helper


Joined: 21 Sep 2006
Posts: 102
Location: Dortmund

PostPosted: Sun Sep 30, 2007 7:29 pm    Post subject: Reply with quote

Hey,
Thanks for your kind reply.

I am using bash allright.

-Chris.
_________________
Registered Linux User #38359 (http://counter.li.org)
Back to top
View user's profile Send private message
Emopig
Apprentice
Apprentice


Joined: 15 Mar 2006
Posts: 188

PostPosted: Mon Oct 01, 2007 10:00 am    Post subject: Reply with quote

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
View user's profile Send private message
creiss
Tux's lil' helper
Tux's lil' helper


Joined: 21 Sep 2006
Posts: 102
Location: Dortmund

PostPosted: Mon Oct 01, 2007 10:16 am    Post subject: Reply with quote

Anything is better than stalling the system. Let it dump, fault... anything!

-Chris.
_________________
Registered Linux User #38359 (http://counter.li.org)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum