Operating System - HP-UX
1751693 Members
5069 Online
108781 Solutions
New Discussion юеВ

Limit memory usage per usage

 
SOLVED
Go to solution
Carter Jay
Advisor

Limit memory usage per usage

Hello,

How can I limit the usage of the memory per user?

Regards

Jerome
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: Limit memory usage per usage

Hi Jerome:

You could use 'ulimit'. Have a look at the 'sh_posix' man pages.

# ulimit -a #...list all limits
# ulimit -d #...show KB size of data area
# ulimit -d value ...set KB size of data area

Regards!

...JRF...
Steve Steel
Honored Contributor
Solution

Re: Limit memory usage per usage

Hi

How far do you want to take it.

Go to www.docs.hp.com

Search on PRM (Process Resource Manager)

How PRM manages real memory



Memory management refers to the rules that govern real and virtual memory and allow for sharing system resources by user and system processes.
In order to understand how PRM manages real memory, it is useful to understand how PRM interacts with standard HP-UX memory management.

How HP-UX manages memory

The data and instructions of any process (a program in execution) must be available to the CPU by residing in real memory at the time of execution. Real memory is shared by all processes and the kernel.

To execute a process, the kernel executes through a per-process virtual address space that has been mapped into real memory. Memory management allows the total size of user processes to exceed real memory by using an approach termed demand-paged virtual memory. Virtual memory enables you to execute a process by bringing into real memory parts of the process only as needed and pushing out parts of a process that have not been recently used.

The system uses a combination of paging and swapping to manage virtual memory. Paging involves writing unreferenced pages from real memory to disk periodically.

Swapping takes place if the system is unable to maintain a large enough free pool of memory. In such a case, entire processes are swapped. The pages associated with these processes can be written out by the pager to secondary storage over a period of time.

The more real memory a system has available, the more data it can access and the more (or larger) processes it can execute without having to page or cause swapping.

Available memory

A portion of real memory is always reserved for the kernel (/stand/vmunix) and its data structures, which are dynamically allocated. The amount of real memory not reserved for the kernel and its data structures is termed available memory. Available memory is consumed by user processes and also nonkernel system processes such as network daemons. Because the size of the kernel varies depending on the number of interface cards, users, and values of the tunable parameters, available memory varies from system to system.

For example, Table 8 shows a system with 1024 Mbyte of physical memory. Approximately 112 Mbyte of that memory is used by the kernel and its data structures, leaving 912 Mbyte of memory available for all processes, including system processes. In this example, 62 Mbyte is used by system processes, leaving 850 Mbyte of memory available for user processes. PRM reserves 11% of the remaining memory to ensure processes in PRM_SYS have immediate access to needed memory. Although you cannot initially allocate this reserve to your PRM groups, it is still available for your PRM groups to borrow from when needed. So, in this example, the prmavail command would show 850 Mbyte of available memory before PRM is configured, and 756 Mbyte of available memory after PRM is configured.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
NightHawk_1
Frequent Advisor

Re: Limit memory usage per usage

Becareful before you do this. If your users are only printing out letters it should be okay but if you have someone that must print out lots of reports and print a lot of documents in color, you keep them from processing jobs in a timely manner and you most definitely will start getting complaints. You need to check to see what type of use each user has a need for.
Bite Me