Date: Sun, 17 Dec 1995 13:41:18 EDT From: "Kaleb S. KEITHLEY" <kaleb@x.org> To: hackers@freefall.FreeBSD.org Subject: Re: growing X server processes Message-ID: <199512171841.SAA19173@exalt.x.org> In-Reply-To: Your message of Fri, 15 Dec 1995 13:37:05 EDT. <6990.819031025@critter.tfs.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> > I use it for everything. Without gnumalloc my server would easily > > grow to ~10meg and never shrink. This was not very good on my 8meg ram/ > > 32meg swap machine to have a third of my swap consumed by unused server > > > You should try out the malloc in -current then. I would probably do even > better than gnumalloc in low-ram environments. > Here's a patch that is a slight improvement over the malloc.c in -current. If you run a ktrace on the simple test program that I posted previously you'll see that it behaves a little better in that case. But it's still not perfect. With this patch my X server idles at ~3.5meg, as opposed to ~4meg without it and ~3meg using gnumalloc. I think this points out that your free page management needs to be rethought. -- Kaleb *** /usr/src/lib/libc/stdlib/malloc.c-current Sun Dec 17 06:55:28 1995 --- /usr/src/lib/libc/stdlib/malloc.c Sun Dec 17 08:18:21 1995 *************** *** 493,498 **** --- 493,499 ---- malloc_init () { char *p; + static void * malloc_bytes (size_t); #ifdef EXTRA_SANITY malloc_junk = 1; *************** *** 593,598 **** --- 594,606 ---- malloc_ninfo = malloc_pagesize / sizeof *page_dir; + /* + hackity hack hack, pre-allocate the freepage list pointer to + improve odds of being able to return pages to the OS that are + allocated by the first calls to malloc. + */ + px = (struct pgfree *) malloc_bytes (sizeof(struct pgfree)); + /* Been here, done that */ initialized++; } *************** *** 990,996 **** pf = px; px = 0; } else if (pf->end == ptr ) { ! /* Append to the previuos entry */ pf->end += l; pf->size += l; if (pf->next && pf->end == pf->next->page ) { --- 998,1004 ---- pf = px; px = 0; } else if (pf->end == ptr ) { ! /* Append to the previous entry */ pf->end += l; pf->size += l; if (pf->next && pf->end == pf->next->page ) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512171841.SAA19173>