Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allocating Memory per process / command

Status
Not open for further replies.

Kressmark

Instructor
Apr 28, 2003
158
US
Hi,

Is there a way of limiting the ammount of memory an application can grab?

If my computer have 512MB I want application A to use only 128MB no matter if application B is using 128MB or 0MB.

/mk
 
Why would you need to? An application uses as much memory as it needs, if it can't get that much, it would most likely fail.

//Daniel
 
Check out 'ulimit'. You can set limits on per-user basis. Don't remember the exact name, but there's something like /etc/login.defs that has a lot of 'ulimit' type of stuff defined (very distro-dependant mind you). Like DanielHozac said though, if the app needs it, it will probably die if you don't let it get the memory it needs. 'ulimit' is good for keeping runaway processes from taking down the box though (like when you use PHP and try experimenting with recursive MySQL queries and it goes up in smoke ;-) )

----
JBR
 
Thanks Guys,

I'll Check out that program.

The reason I want to limit the memory use is beacuse I have an application that right away took all 512MB RAM available in a system. Then we upgraded to 1GB of RAM just to find out that the application happily grabbed that too.
Of course I could start all other applications first and then my memory hog, but I would rather restrict it more.

/mk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top