Re: Memory size?

From: Michael Wojcik (mwojcik_at_newsguy.com)
Date: 06/09/04


Date: 9 Jun 2004 15:50:52 GMT


In article <ca6ujf$6mh$7@sunnews.cern.ch>, Dan.Pop@cern.ch (Dan Pop) writes:
>
> IIRC, AIX actually sent a signal to the program, when this happened.
> If you didn't catch it and take whatever measures were appropriate,
> you have only yourself to blame.

Correct. When paging space runs low, AIX sends SIGDANGER to every
user process. A few seconds later, if memory consumption has not
been reduced, it begins to send SIGKILL to those processes which *did
not catch SIGDANGER* and are consuming the most virtual memory. It
only begins killing processes which received SIGDANGER and caught it
if the low-memory condition continues.

Processes can also poll for low-paging-space conditions using the
psdanger system call.

In other words, there's ample opportunity for every program to detect
the low-memory condition and take appropriate action, like
checkpointing its state and perhaps releasing some memory. The
latter is more feasible for some programs than for others, of course,
but most AIX programs can trivially return some memory to the system
using the mallopt function with the M_DISCLAIM command, which tells
the malloc subsystem to return freed pages to the OS (via the
disclaim system call). This is completely transparent to the
application - they remain mapped in the app's address space, and will
be reallocated from the VMM pool if and when they're needed to
satisfy future malloc requests.

This is all in the AIX documentation. Much of it is right in the
malloc man page.

Frankly, I'd be pretty suspicious of any application that runs for an
hour without checkpointing, as in Richard's example. Low virtual
memory is hardly the only condition which might interrupt it.

-- 
Michael Wojcik                  michael.wojcik@microfocus.com
I will shoue the world one of the grate Wonders of the world in 15
months if Now man mourders me in Dors or out Dors
   -- "Lord" Timothy Dexter, _A Pickle for the Knowing Ones_


Relevant Pages

  • Re: Pressure on malloc
    ... Memory storage is atomic on PowerPC. ... - There is no way that this program should ever corrupt malloc. ... The locking is performed entirely within the AIX algorithms ... ... I also increase nNew values to large numbers, ...
    (comp.unix.aix)
  • Re: Protecting Memory Regions
    ... > The memory might be allocated via malloc or mmap. ... > I'm interested in solutions for AIX and Linux ...
    (comp.unix.programmer)
  • Re: Strange malloc() behaviour on AIX
    ... If I change the memory ... a condition that the malloc subsystem could detect and manage properly. ... then the same program allocate up to 700 Mb of memory. ... Move up to AIX 5.1 or .2. ...
    (comp.unix.aix)
  • AIX 5.2 maxperm & Oracle
    ... maxperm was set to 63%, ... large volumes of data IO going through the AIX filesystem cache). ... for memory with filesystem cache. ...
    (comp.unix.aix)
  • Re: MAssive Performance hit after AIX 4.3 -> 5.2 upgrade!!
    ... that really does sound like the system is memory and/or I/O-starved ... My current hypothesis is that you were already low on memory in AIX ... Put it in /tmp on the remote AIX box. ... Do these commands to install it: ...
    (comp.unix.aix)