LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-18-2001, 08:11 AM   #1
Costea
LQ Newbie
 
Registered: Aug 2001
Posts: 1

Rep: Reputation: 0
Question Process memory limit


Hi, I have RedHat 7.0 and I'm wondering how to make a process not to be able to use more that X Mb of memory. If it does I want that process killed.

Costea
 
Old 08-19-2001, 06:20 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
not sure about memory limits .... but you can set the priority of a process with the nice command.... that might a solution

man nice for more info....
 
Old 08-20-2001, 05:36 AM   #3
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Rep: Reputation: 15
Not sure how to use it.
But check out the man page for bash and look for ulimit.
Try ulimit on its own from the command line and see what its set to. Mine says unlimited. I think you can set limits on system resources with this.
 
Old 08-20-2001, 01:03 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
ulimit sets the limit on a particular file size, not memory used on it.
 
Old 08-22-2001, 08:58 PM   #5
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
ulimit is a built in command in the shell. It will restrict any processes from exceeding the set criteria. You have the following options, memory included:

Code:
# ulimit -a
core file size (blocks)     0
data seg size (kbytes)      unlimited
file size (blocks)          unlimited
max locked memory (kbytes)  unlimited
max memory size (kbytes)    unlimited
open files                  1024
pipe size (512 bytes)       8
stack size (kbytes)         8192
cpu time (seconds)          unlimited
max user processes          1024
virtual memory (kbytes)     unlimited
Gary
 
Old 08-22-2001, 09:00 PM   #6
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
I forgot to mention. Do a man on bash and search for ulimit.
 
Old 05-25-2002, 10:36 PM   #7
Druaga
Member
 
Registered: May 2002
Location: Canada
Distribution: Slackware
Posts: 111

Rep: Reputation: 15
what does "max CPU time" mean exactly??
 
Old 09-24-2006, 09:37 AM   #8
paracelsus
LQ Newbie
 
Registered: Jul 2005
Distribution: Gentoo
Posts: 9

Rep: Reputation: 0
Quote:
Originally Posted by Druaga
what does "max CPU time" mean exactly??
It means maximum time of the processor that is available to a single process. It is not the time of the process being alive; it's the time of the CPU that the process has used.
 
Old 09-24-2006, 10:30 AM   #9
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
If you are using PAM, and you probably are, then use the /etc/security/limits.conf file to establish process limits.

ulimit is a bash shell function. If you are using another shell then ulimit is not available.
 
Old 09-24-2006, 01:42 PM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Please do not revive stale threads unless there's an urgent reason to.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Configuring the Memory Used by a Process in RedHat? (Cache Memory on CPU) geogecko Linux - General 3 02-23-2005 03:32 PM
Want to limit Memory to a specific Process tstaples Linux - General 3 01-26-2005 01:59 PM
Linux process limit kangaman Linux - General 4 10-14-2004 02:48 PM
Descriptor limit for a process akuate Linux - General 0 08-18-2004 11:23 AM
max process limit anoop_chandran Linux - Networking 2 01-16-2002 05:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:08 AM.

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