Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: alan@nabeth.cxo.dec.com (Alan Rollow - Dr. File System's Home for Wayward Inodes.)
Subject: Re: malloc failed
Date: 1999/06/04	[thread overview]
Message-ID: <7j9l75$lal$1@nntpd.lkg.dec.com> (raw)
In-Reply-To: 3749DDD7.E9964607@interra.com


In article <3749DDD7.E9964607@interra.com>, Asif Khalil Ansari <asifa@interra.com> writes:

>I am facing this problem on a DEC Alpha running DU 4.0. Whenever I load
>a very large testcase running into upwards of 200 MB, in our tool, it
>seems to use up all the memory and then crash. malloc fails when the
>process memory utilization reaches around 140MB, as reported by ps.

First, you really should be checking the status of malloc and gracefully
coping with the condition, rather than letting use the NULL pointer that
comes back when it fails to allocate memory...

>This
>is close to the amount of physical memory available on the machine. Swap
>appears to be totally unused by this process as indicated by swapon -s,
>which shows swap utilization hovering around 1-2% . Any pointers on what
>I need to do to ensure swap space usage ?

Digital UNIX (Tru64 UNIX and DEC OSF/1) has a variety of ways that the
virtual memory of a process is limited.  The three most frequently
encountered are running out of page/swap space, reaching the process
data size limit and reaching the process stack size limit.  In your
case I'd guess that the program has reach the data size limit.

Without other tuning, the system maximum for the data size limit is
1 GB, but many shells set the limit to 128 MB.  Since this about the
place that your process is having malloc fail, that's probably the
problem.  Most shells have a built-in command to change the limit
from the default up to the maximum; usually ulimit or limit.

There are configuration parameters to control the maximum sizes
for data and stack as well the default sizes.  There is also
an documentation CDROM that came with the distribution that has
the system management documentation on it.  One of the books
should explain how to use sysconfig to raise the limit.

>Could this be a problem with the way our tool is allocating memory ?

As I mentioned before, the process core dump is probably the result
of not dealing with a system call that has failed.  The rest depends
on outside features.

>I am loath to believe that, as
>the same tool works just fine with 128 MB of physical memory on a Sun
>Sparc. running Solaris 5.5.1.

They must have a higher data size limit, or someone figured out how
to raise the maximum and/or default...

>
>Thanks!
>-- Asif Ansari
>
>---------------------------------------------------------------------
>ASIF KHALIL ANSARI                      Interra, Inc.
>
--
Alan Rollow				alan@nabeth.cxo.dec.com




      reply	other threads:[~1999-06-04  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-24  4:00 malloc failed Asif Khalil Ansari
1999-06-04  4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes. [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox