Re: IRIX Arena size

New Message Reply Date view Thread view Subject view Author view

reiners++at++igd.fhg.de
Sat, 30 Sep 1995 01:04:40 +0100


On Sep 29, 15:32, ken sartor wrote:
> Subject: IRIX IPC
>
> Hi -
>
> This is not really a performer question but...
>
> I am using IRIX shared memory to communicate data from
> a non-performer app to a performer app with the following
> problem. It works just fine until i increase the memory
> above a certain amount (about 120K). Then the usmalloc
> returns a NULL and problems arise. Any ideas?
>
>-- End of excerpt from ken sartor

This is one of the problems I've run into, too. At arena creation time you have
to specify the maximum size your arena can have. If you ever exceed that size
you'll get no more mem.

My solution was to estimate how much I could reasonably get with the following
code snippet:

#include <sys/resource.h>
#include <sys/swap.h>
#include <invent.h>
#include <sys/invent.h>

        {
        struct rlimit data, vmem;
        off_t swap;
        long size;
        inventory_t *inv;

        swapctl(SC_GETFREESWAP, &swap); swap*=512;
        getrlimit(RLIMIT_VMEM, &vmem);
        getrlimit(RLIMIT_DATA, &data);

        for (inv=getinvent(); inv &&
                 (inv->inv_class!=INV_MEMORY || inv->inv_type!=INV_MAIN);
                 inv=getinvent());

        size=min(min(data.rlim_cur, vmem.rlim_cur), (swap+inv->inv_state)*.9);

        usconfig(CONF_INITSIZE, size);
        }

This will allocate an arena size of the minimum of

- maximum process data size, as defined by setrlimit
- maximum process virtual memory size, as defined by setrlimit
  (these are usually 512MB)
- 90% of (free swap space + main memory size)

It think this makes sense, but any comments are welcome.

BTW, I thought the default size was 64K, so if you don't set any, you should
have had the problem much earlier.

        Dirk


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:55 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.