Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Re: strace/mmap/munmap/mremap wierdness
       [not found] <19980123025057.26497@dot.cygnus.com>
@ 1998-01-23 20:09 ` Aleksandr Pilosov
  0 siblings, 0 replies; 2+ messages in thread
From: Aleksandr Pilosov @ 1998-01-23 20:09 UTC (permalink / raw)


On Fri, 23 Jan 1998, Richard Henderson wrote:

> On Fri, Jan 23, 1998 at 01:51:27AM -0500, Aleksandr Pilosov wrote:
> > While stracing my application, I noticed that it generates an unusual
> > number of mmap/munmap syscalls (a lot). This doesn't happen on i386
> > machine (with rh4.1 and linux libc). I wonder if glibc implements malloc
> > in terms of mmap? 
> 
> "Large" allocations are handled with mmap, to prevent the nastiest
> bit of fragmentation that can happen.  Don't recall what the specific
> numbers are for cutoffs...

Well, my mmap calls have size of 8k, I doubt that is a large chunk of
memory. Maybe it thinks that if you malloc/free exactly 8k (1 page worth)
of memory, its easier to use mmap (which is probably a good assumption)?

Is using mmap faster than brk() and managing the space yourself?

*goes to grab glibc source and read the malloc code*

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: strace/mmap/munmap/mremap wierdness
       [not found] <Pine.GSO.3.96.980123150632.22482C-100000@utopia.poly.edu>
@ 1998-01-23 22:24 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 1998-01-23 22:24 UTC (permalink / raw)


On Fri, Jan 23, 1998 at 03:09:13PM -0500, Aleksandr Pilosov wrote:
> Well, my mmap calls have size of 8k, I doubt that is a large chunk of
> memory.

No, I was thinking the bottom cutoff was something like 64k or more...

> Is using mmap faster than brk() and managing the space yourself?

The same (brk calls mmap inside the kernel), but it is easier to give
memory back to the system using mmap, since you are not bound to a
stack model.

r~

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-01-23 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <19980123025057.26497@dot.cygnus.com>
1998-01-23 20:09 ` strace/mmap/munmap/mremap wierdness Aleksandr Pilosov
     [not found] <Pine.GSO.3.96.980123150632.22482C-100000@utopia.poly.edu>
1998-01-23 22:24 ` Richard Henderson

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