Thursday, March 24, 2011

Out Of Memory Error

Execute prctl $$ command to  use the current shell process to determine resource limits


A threshold value on a resource control constitutes a point at which local actions can be triggered or global actions, such as logging, can occur.
Each threshold value on a resource control must be associated with a privilege level. The privilege level must be one of the following three types:
basic
Can be modified by the owner of the calling process.
privileged
Can be modified by the current process (requiring sys_resource privilege) or by prctl(1) (requiring proc_owner privilege).
system
Fixed for the duration of the operating system instance.
A resource control is guaranteed to have one system value, which is defined by the system, or resource provider. The system value represents how much of the resource the current implementation of the operating system is capable of providing.
Any number of privileged values can be defined, and only one basic value is allowed. Operations that are performed without specifying a privilege value are assigned a basic privilege by default.

If you see "Out of memory errors" , you may want to enable logging of resource control limit threshold.
By default, Solaris 10  does not  log resource limit threshold notifications. You can see whether they are enabled or not by using the “rctladm” command:

To turn on the syslog for "project.max-shm-memory", issue the following:
rctladm -e syslog project.max-shm-memory



To set the process.max-address.space to 20GB, add the following line to /etc/project
         

user.ben:12345::::process.max-address.space=(privileged,20000000000,deny)

An example of /etc/project:
user.oracle:100::::process.max-address-space=(privileged,40240000000,deny);proce
ss.max-data-size=(priv,10737418240,deny);process.max-sem-nsems=(priv,8192,deny);
process.max-stack-size=(priv,10737418240,deny);project.max-file-descriptor=(priv
,65536,deny);project.max-sem-ids=(priv,100,deny);project.max-shm-ids=(priv,8192,
deny);project.max-shm-memory=(privileged,2199023255552,deny)




This setting however only takes effect for new processes and not for existing process.

ie prctl $$ (will continue to show old value for process.max-address-space)
'
$ su oracle -c 'sh -c "prctl $$"' (will show the new value as you are starting a new shell)
or ...su oracle -c 'sh -c "xterm"'

No comments:

Post a Comment