Re: free() not freing pagedirs pages.

2000-12-07 Thread Matt Dillon
:Well, I may think using this solution if it remains portable between :Unixes. I finally tracked down the problem, after suppressing the :reason to call __smakebuf and tooling malloc.c. : :What happens is that malloc() uses the pages to store pginfo chains. If :all memory is used, it allocates hig

Re: free() not freing pagedirs pages.

2000-12-07 Thread Matt Dillon
Er, I obviously meant 'not use mmap' in that last posting. I'm sure that first sentence was confusing :-) -Matt To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message

Re: free() not freing pagedirs pages.

2000-12-07 Thread Matt Dillon
: :Dag-Erling Smorgrav <[EMAIL PROTECTED]> writes: :> Remy Nonnenmacher <[EMAIL PROTECTED]> writes: :> > Well, I may think using this solution if it remains portable between :> > Unixes. :> It's perfectly portable, with one small variation - on BSD systems, :> you pass -1 instead of a file descri

Re: free() not freing pagedirs pages.

2000-12-07 Thread Poul-Henning Kamp
>> Please examine the 'H' option to malloc. This does a much better >> job. >> >I agree about the hints, but as i said at the end of my previous mail, >this is hardly a clean-bill winning response against a customer >sighting a 30/40 Mbytes 'top' column ;). Top is not a very good indicator of

Re: free() not freing pagedirs pages.

2000-12-07 Thread Remy Nonnenmacher
On 7 Dec, Poul-Henning Kamp wrote: > In message <[EMAIL PROTECTED]>, Remy Nonnenmacher wr > ites: > >>Well, I may think using this solution if it remains portable between >>Unixes. I finally tracked down the problem, after suppressing the >>reason to call __smakebuf and tooling malloc.c. > > Pl

Re: free() not freing pagedirs pages.

2000-12-07 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, Remy Nonnenmacher wr ites: >Well, I may think using this solution if it remains portable between >Unixes. I finally tracked down the problem, after suppressing the >reason to call __smakebuf and tooling malloc.c. Please examine the 'H' option to malloc. This does

Re: free() not freing pagedirs pages.

2000-12-07 Thread Dag-Erling Smorgrav
Dag-Erling Smorgrav <[EMAIL PROTECTED]> writes: > Remy Nonnenmacher <[EMAIL PROTECTED]> writes: > > Well, I may think using this solution if it remains portable between > > Unixes. > It's perfectly portable, with one small variation - on BSD systems, > you pass -1 instead of a file descriptor, whi

Re: free() not freing pagedirs pages.

2000-12-07 Thread Dag-Erling Smorgrav
Remy Nonnenmacher <[EMAIL PROTECTED]> writes: > Well, I may think using this solution if it remains portable between > Unixes. It's perfectly portable, with one small variation - on BSD systems, you pass -1 instead of a file descriptor, while on SysV systems, you pass a descriptor to /dev/zero (o

Re: free() not freing pagedirs pages.

2000-12-07 Thread Remy Nonnenmacher
On 6 Dec, Matt Dillon wrote: > : > :OK. In fact my problem was just a printf that allocated a buffer via > :__smakebuf at the very last moment (when all memory was allocated). > :This prevent free() to give back all previous pages up to this one. The > :problem was _not_ in malloc.c. > : > :Anywa

Re: free() not freing pagedirs pages.

2000-12-06 Thread Matt Dillon
: :OK. In fact my problem was just a printf that allocated a buffer via :__smakebuf at the very last moment (when all memory was allocated). :This prevent free() to give back all previous pages up to this one. The :problem was _not_ in malloc.c. : :Anyway, i learned a lot from hacking the source t

Re: free() not freing pagedirs pages.

2000-12-06 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, Remy Nonnenmacher wr ites: >OK. In fact my problem was just a printf that allocated a buffer via >__smakebuf at the very last moment (when all memory was allocated). >This prevent free() to give back all previous pages up to this one. The >problem was _not_ in mallo

Re: free() not freing pagedirs pages.

2000-12-06 Thread Remy Nonnenmacher
OK. In fact my problem was just a printf that allocated a buffer via __smakebuf at the very last moment (when all memory was allocated). This prevent free() to give back all previous pages up to this one. The problem was _not_ in malloc.c. Anyway, i learned a lot from hacking the source to catch

Re: free() not freing pagedirs pages.

2000-12-06 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, Remy Nonnenmacher wr ites: >>From the /usr/src/lib/libc/stdlib/malloc.c sources, it seems that this >is due to not shrinking/relocating pagedir pages (free_pages(), comment >around line 940). This means that returning pages stop at first >allocated pagedir. That i

free() not freing pagedirs pages.

2000-12-06 Thread Remy Nonnenmacher
Hello, I'm encountering a problem with the stardard libc malloc/free library. if a program allocates a huge (and temporary) amount of memory with small structures then free it, the library gives back only a few pages to the system. >From the /usr/src/lib/libc/stdlib/malloc.c sources, it seems th