Re: [Q]



On Sun, Jan 27, 2002 at 09:48:57PM +0100, Pawel Salek wrote:
> On 2002.01.26 12:34 Emmanuel wrote:
> > 	Hi all,
> > I have a big mailbox (>3500 messages) and with top I see that when 
> > this mailbox is opened balsa takes 16M. That's a lot but I checked 
> > the mbox file, it is about 16M also, so I think it's OK. But if I 
> > close the mailbox Balsa does not release the memory. Is it just 
> > because of how the memory is managed by the kernel or glib, or is it 
> > bad practice from us?
> 
> I do not know of any way (apart from playing with brk) to shrink the 
> memory segment extended by libc when calling malloc/calloc. The memory 
> released with free() is available for subsequent malloc calls, though.
> 

true, recent glibcs usually don't give memory back so the program never
shrinks. that's done cause brk() is somewhat heavy.

memprof should reveal the truth though as it traces allocs/frees via 
ptrace

-- 
Carlos Morgado - chbm(at)chbm(dot)nu - http://chbm.nu/ -- gpgkey: 0x1FC57F0A 
http://wwwkeys.pgp.net/ FP:0A27 35D3 C448 3641 0573 6876 2A37 4BB2 1FC5 7F0A
[there is no .sig available at the moment - please hold]



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]