Unix Technical Forum

overcommit Memory on Solaris

This is a discussion on overcommit Memory on Solaris within the comp.unix.solaris forums, part of the Solaris Operating System category; --> Hello, i have seen an interessting thing on AIX the last days: it kills processes when it comes to ...


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > comp.unix.solaris

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-20-2008, 01:41 PM
Wolfgang
 
Posts: n/a
Default overcommit Memory on Solaris

Hello,

i have seen an interessting thing on AIX the last days: it kills
processes when it comes to an overcommit on memory, i.e. the systems can
give memory exceeding the "virtual memory". Linux and BSD have similar
OutOfMem-Killers. does something similar exist in Solaris?

I dont think this is an usefull behavior, but overcommiting memory is
interesting idea, since every project claims to need a lot of memory
which is not used in fact.


I run some tests and see that Solaris can give away nearly all virtuall
memory, but do not overcommit.
Nevertheless there are some questions:

a) can Solaris overcommit memory like Linux/AIX/BSD, e.g. by tunables?

b) what happens to the kernel, when all virtuell memory is filled and
e.g. a kernel module must be loaded, maybe a driver, or a cronjob
starts or a daemon forks. Does it panic, or just dont start new memory
eaters?

c) since what version of Solaris you dont have to reserve
"swap space"="physical memory", i remember 5.6 rightly?

d) is there a tunable to limit usage of swap as space for paging (not
the parameter limit for tmpfs) global or for processes? I think there is
something for virtual memory.

e) I have seen there was an kernel tunable for the reserved paging
space, how big is it on typically system (sorry, no pdf by hand) and is
there a tunable for this reserved for kernel memory usage.

Please dont send me to "SOlaris INternals", the Memory part is one of
the hardest to me ;-(, and I have not found the answers for the OOM Case
for kernel, s. b).

THanks
Wolfgang
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-20-2008, 01:41 PM
Casper H.S. Dik
 
Posts: n/a
Default Re: overcommit Memory on Solaris

Wolfgang <wtrappe@AT.web.de> writes:

>i have seen an interessting thing on AIX the last days: it kills
>processes when it comes to an overcommit on memory, i.e. the systems can
>give memory exceeding the "virtual memory". Linux and BSD have similar
>OutOfMem-Killers. does something similar exist in Solaris?


No, Solaris does not generally over commit memory with on exception:
process and thread stacks and memory mmaped with MAP_NORESERVE.

Memory allocated will be available when used; the only thing that can
cause a process to die is when it attempts to grow its stack and
there is no more memory available.

>I dont think this is an usefull behavior, but overcommiting memory is
>interesting idea, since every project claims to need a lot of memory
>which is not used in fact.


Right; that's why you'd want to have swap space; it's cheap and it's
where unused memory can be reserved from (swap -s ' reserved column)

>a) can Solaris overcommit memory like Linux/AIX/BSD, e.g. by tunables?


No, except for the exceptions listed above.

>b) what happens to the kernel, when all virtuell memory is filled and
>e.g. a kernel module must be loaded, maybe a driver, or a cronjob
>starts or a daemon forks. Does it panic, or just dont start new memory
>eaters?


In the kernel one of two things can happen: the memory allocation fails
or the system will wait until memory becomes available.

System calls like fork() will fail with an appropriate error code.
The system should not panic.

>c) since what version of Solaris you dont have to reserve
>"swap space"="physical memory", i remember 5.6 rightly?


Never in Solaris 2.x; the system runs without swap space.

>d) is there a tunable to limit usage of swap as space for paging (not
>the parameter limit for tmpfs) global or for processes? I think there is
>something for virtual memory.


No. The system doesn't really distinguish between memory uses in that
way (all you can do is limit swap space but that has effects on
everything)

>e) I have seen there was an kernel tunable for the reserved paging
>space, how big is it on typically system (sorry, no pdf by hand) and is
>there a tunable for this reserved for kernel memory usage.


The system tries to keep a small percentage of memory free at all times.

That's not really a tunable (it's self-tuned)

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-20-2008, 01:41 PM
Tim Bradshaw
 
Posts: n/a
Default Re: overcommit Memory on Solaris

On Mar 20, 8:27 am, Wolfgang <wtra...@AT.web.de> wrote:

> I run some tests and see that Solaris can give away nearly all virtuall
> memory, but do not overcommit.
> Nevertheless there are some questions:
>
> a) can Solaris overcommit memory like Linux/AIX/BSD, e.g. by tunables?


Everything Casper said is, of course, right. There is a good paper
which describes some of the issues with overcommit:
http://developers.sun.com/solaris/ar...ry_arrays.html.

One of the problems with overcommit as naïvely implemented is that
there's really no correlation between the process which causes the
immediate problem (shortage of memory) and the actual bad guy. So the
OOM killer often can kill completely the wrong process, which is a bad
thing.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-20-2008, 01:41 PM
Casper H.S. Dik
 
Posts: n/a
Default Re: overcommit Memory on Solaris

Tim Bradshaw <tfb+google@tfeb.org> writes:

>On Mar 20, 8:27 am, Wolfgang <wtra...@AT.web.de> wrote:


>> I run some tests and see that Solaris can give away nearly all virtuall
>> memory, but do not overcommit.
>> Nevertheless there are some questions:
>>
>> a) can Solaris overcommit memory like Linux/AIX/BSD, e.g. by tunables?


>Everything Casper said is, of course, right. There is a good paper
>which describes some of the issues with overcommit:
>http://developers.sun.com/solaris/ar...ry_arrays.html.


>One of the problems with overcommit as na=EFvely implemented is that
>there's really no correlation between the process which causes the
>immediate problem (shortage of memory) and the actual bad guy. So the
>OOM killer often can kill completely the wrong process, which is a bad
>thing.


I've heard of an implementation which targeted the largest process and
ended up killing the most important process (Oracle, IIRC)

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-28-2008, 05:29 AM
Wolfgang
 
Posts: n/a
Default Re: overcommit Memory on Solaris

Casper H.S. Dik schrieb:
> Tim Bradshaw <tfb+google@tfeb.org> writes:
>
>> On Mar 20, 8:27 am, Wolfgang <wtra...@AT.web.de> wrote:

>
>>> I run some tests and see that Solaris can give away nearly all virtuall
>>> memory, but do not overcommit.
>>> Nevertheless there are some questions:
>>>
>>> a) can Solaris overcommit memory like Linux/AIX/BSD, e.g. by tunables?

>
>> Everything Casper said is, of course, right. There is a good paper
>> which describes some of the issues with overcommit:
>> http://developers.sun.com/solaris/ar...ry_arrays.html.

>
>> One of the problems with overcommit as na=EFvely implemented is that
>> there's really no correlation between the process which causes the
>> immediate problem (shortage of memory) and the actual bad guy. So the
>> OOM killer often can kill completely the wrong process, which is a bad
>> thing.

>
> I've heard of an implementation which targeted the largest process and
> ended up killing the most important process (Oracle, IIRC)
>
> Casper


yes, in our case the cluster processes are been killed, which are not a
good idea ....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-28-2008, 05:29 AM
Andrew Gabriel
 
Posts: n/a
Default Re: overcommit Memory on Solaris

In article <47e22cb2$0$14352$e4fe514c@news.xs4all.nl>,
Casper H.S. Dik <Casper.Dik@Sun.COM> writes:
> Wolfgang <wtrappe@AT.web.de> writes:
>
>>b) what happens to the kernel, when all virtuell memory is filled and
>>e.g. a kernel module must be loaded, maybe a driver, or a cronjob
>>starts or a daemon forks. Does it panic, or just dont start new memory
>>eaters?

>
> In the kernel one of two things can happen: the memory allocation fails
> or the system will wait until memory becomes available.


Before we got to that point, there's some active purging such as
unloading kernel modules which are not currently in use.

--
Andrew Gabriel
[email address is not usable -- followup in the newsgroup]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 03-28-2008, 05:29 AM
Giorgos Keramidas
 
Posts: n/a
Default Re: overcommit Memory on Solaris

On 20 Mar 2008 11:08:37 GMT, Casper H.S. Dik <Casper.Dik@Sun.COM> wrote:
> Tim Bradshaw <tfb+google@tfeb.org> writes:
>>One of the problems with overcommit as naívely implemented is that
>>there's really no correlation between the process which causes the
>>immediate problem (shortage of memory) and the actual bad guy. So the
>>OOM killer often can kill completely the wrong process, which is a bad
>>thing.

>
> I've heard of an implementation which targeted the largest process and
> ended up killing the most important process (Oracle, IIRC)


Heh, that must have been lots of fun

I've seen OOM kill a named process which happened to have a very large
cache too. Amusing but annoying after the second time it happened.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 03-28-2008, 05:29 AM
Daniel Rock
 
Posts: n/a
Default Re: overcommit Memory on Solaris

Giorgos Keramidas <keramida@ceid.upatras.gr> wrote:
> I've seen OOM kill a named process which happened to have a very large
> cache too. Amusing but annoying after the second time it happened.


http://lkml.org/lkml/2004/9/23/311

--
Daniel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:40 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com