LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-26-2005, 11:22 AM   #1
tstaples
LQ Newbie
 
Registered: Jan 2005
Location: Massachusetts
Posts: 2

Rep: Reputation: 0
Want to limit Memory to a specific Process


Hi All,

Ok.. i've researched and researched and only found a way to limit the amount of memory consumed by the entire system.

Now, what i want to do is this.

I have process running X

I want to say, hey process X you can only have 128 megs of memory to use...

and then see how process X responds, fails, dies, stabilizes.. etc...

All i can find is stuff about using ulimit to limit the memory of the system.

Anyone know of any tools out there that limit the amount of memory that is able to be allocated to a specific process and it's forked processes?

Maybe this is a huge request, and nothing has been done in this area yet. But i figured i'd ask.


In case you're wondering why the Heck i'd want to do such a thing, I'm a Test Infrastructure Architect for Motorola. This is the type of negative testing we do sometimes.

Thanks in advance
 
Old 01-26-2005, 01:07 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Actually, if you do use ulimit, it will limit the memory to your current shell and all subprocesses. Given that the shell uses very little memory, this can be a close test.
 
Old 01-26-2005, 01:30 PM   #3
tstaples
LQ Newbie
 
Registered: Jan 2005
Location: Massachusetts
Posts: 2

Original Poster
Rep: Reputation: 0
The programs/processes i want to limit are started during initialization. But maybe i could restart them in the shell i'm in, and do a ulimit that way. Hmmm.. good idea

how exactly would I adjust ulimit to do that?

just do a ulimit -m <size in megabytes?>

thanks
 
Old 01-26-2005, 01:59 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
You could also, if they use an initialization script, put the ulimit in there. I believe ulimit -m should be sufficient, man ulimit can tell you more.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Process memory limit Costea Linux - Security 9 09-24-2006 01:42 PM
Upload limit on specific port with Trickle Ducks Linux - Networking 0 06-02-2005 04:51 PM
Limit Incoming Mail to Specific Users barriger Linux - General 1 04-17-2005 10:22 PM
Help Configuring the Memory Used by a Process in RedHat? (Cache Memory on CPU) geogecko Linux - General 3 02-23-2005 03:32 PM
How to limit the size of a specific file ericthyred Linux - Software 1 04-15-2004 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration