Operating System - HP-UX
1755696 Members
3696 Online
108837 Solutions
New Discussion юеВ

Re: Limit process memory usage per process

 
Kevin Moran_1
Occasional Contributor

Limit process memory usage per process

Currently, I have a unix process in production whereby the amount of data being loaded is about to exceed the maxdsiz kernel parameter setting. I really would only like to increase the memory limit for a specific process without enabling for all processes is there a way to do this? We are not using PRM.
2 REPLIES 2
Bill Hassell
Honored Contributor

Re: Limit process memory usage per process

This is quite easy. Set maxdsiz to a large value, perhaps 900 megs. Then in /etc/profile set ulimit to the number of kbytes you'd like as a limit for everyone as in:

ulimit -Sd 100000

(for 100 megs) Then for a specific process, start the process with ulimit -Sc 500000 so this one process gets to use 500 megs.


Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: Limit process memory usage per process

Oops, typo:

ulimit -Sd 500000

which sets maxdsiz to 500 megs temporarily.


Bill Hassell, sysadmin