Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Apr 1996 14:13:49 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        brandon@tombstone.sunrem.com (Brandon Gillespie)
Cc:        gpalmer@FreeBSD.ORG, valtech@caribnet.net, questions@FreeBSD.ORG
Subject:   Re: Free();
Message-ID:  <199604292113.OAA05086@phaeton.artisoft.com>
In-Reply-To: <Pine.BSF.3.91.960427160706.1984A-100000@tombstone.sunrem.com> from "Brandon Gillespie" at Apr 27, 96 04:09:52 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> On Sat, 27 Apr 1996, Gary Palmer wrote:
> > The problem is addressed in 2.2 which a new malloc/free (phkmalloc),
> > but since Netscape is statically linked on BSDI's BSD/OS, we depend on
> > them having a non-leaking malloc... (AFAIK)
> 
> Does phkmalloc actually give memory back to the OS, i.e. can a process
> which has a footprint of 7MB (both VM and actual) actually shrink in size?
> I have heard conflicting answers as to if this is even possible with 
> unix..

Yes and no.

Yes, it sbrk's the pages back to the system.

No, this shouldn't really be a meaningful activity one way or the
other, since unused intermediate pages should be discarded anyway,
regardless of the sbrk setting, and not count against overall
resource utilization.  Using sbrk to stuff pages back it just
one way of achieving the same goal.

More likely, there are object persistance issues that result in
fragmentation because of the way Netscape orderes requests and
the fact that it isn't using per object type page pools (same
goes for the X Server).  Such a system would *require* the
ability to anonymously discard intermediate pages so that they
can be easily recovered.  It would also require a malloc on
the order of a slab allocator that operated on the basis of page
pools, which in turn would require the application to tag each
malloc by pool on the basis of expected persistance.

Really, objects want seperate segments to implement true
persistance algorithms.  Other than OS/2, I don't know of
any OS's that support protection ring2 (system space), as
opposed to ring3 (user space) and ring 0 (kernel space).  Maybe
there's an X86 version of VMS I don't know about...


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604292113.OAA05086>