tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: chu () musp0 ! Jpl ! Nasa ! Gov (Eugene Chu)
To: tru64-unix-managers
Subject: SUMMARY, memory allocation
Date: Fri, 07 Apr 1995 00:44:18 +0000	[thread overview]
Message-ID: <96075319106405.tru64-unix-managers.marc@archive.invalid> (raw)

My original question was about not being able to allocate a large
amount of memory from a program.  Thanks to Alan Rollow and Fabrice Cuq
for their incredibly fast response, I was able to check the one thing
that I missed:  the per process limits.  (This is something that makes
one feel kinda stupid after he realizes the obvious.)

While my default data size limit was already at 128 MB, appearantly
enough of it was used up by something or another so that I could not
allocate 80 MB more of data space within the program.  Upping the data
size limit allowed me to run the program.

Alan's reply:

	V1.3 and V1.2 used a doubling allocation algorithm for
	virtual memory.  For example if malloc uses sbrk to get
	1 MB initially, it will want 2 MB next, then 4 MB and
	so on.  Your 80 MB is probably up in the range of asking
	for 128 MB in addition to what's already been allocated
	and is running up against the data size limit.

	Use the shell built-in to check the datasize limit and
	see if you can raise it.  The system data size looked
	big enough for most things, so the dfldsiz is probably
	the initial limit for the shell.

	In V2.0 the doubling algorithm is replaced by one that
	uses a constant size, which is much more friendly for
	large allocations.

In my case, I boiled down my problem to a simple program with a single
malloc call and upped the number of bytes until it returned NULL.  So
each time the program was run, it only called malloc once.  But it is
good to remember the doubling behavior for other parts of the program.

thanks for the responses.

eugene

             reply	other threads:[~1995-04-07  0:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-04-07  0:44 chu [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-05-12 17:59 SUMMARY: memory allocation Tony Warner
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