From owner-freebsd-bugs@FreeBSD.ORG Sat Jan 26 21:30:02 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E0017734 for ; Sat, 26 Jan 2013 21:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id BAA8E6B for ; Sat, 26 Jan 2013 21:30:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r0QLU2uF050836 for ; Sat, 26 Jan 2013 21:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r0QLU2hi050835; Sat, 26 Jan 2013 21:30:02 GMT (envelope-from gnats) Date: Sat, 26 Jan 2013 21:30:02 GMT Message-Id: <201301262130.r0QLU2hi050835@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: dfilter@FreeBSD.ORG (dfilter service) Subject: Re: bin/173332: commit references a PR X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: dfilter service List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2013 21:30:02 -0000 The following reply was made to PR bin/173332; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/173332: commit references a PR Date: Sat, 26 Jan 2013 21:29:54 +0000 (UTC) Author: ian Date: Sat Jan 26 21:29:45 2013 New Revision: 245949 URL: http://svnweb.freebsd.org/changeset/base/245949 Log: Reduce watchdogd's memory footprint when running daemonized. This uses the recently-added jemalloc(3) feature of setting the lg_chunk tuning option to zero to request that memory be allocated in the smallest chunks possible. Without this option, the default is to initally map 8MB, and then the mlockall() call wires that entire allocation even though the program only uses a few Kbytes of it at runtime. PR: bin/173332 Approved by: cognet (mentor) Modified: head/usr.sbin/watchdogd/watchdogd.c Modified: head/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.c Sat Jan 26 20:16:58 2013 (r245948) +++ head/usr.sbin/watchdogd/watchdogd.c Sat Jan 26 21:29:45 2013 (r245949) @@ -71,6 +71,14 @@ static int nap = 1; static char *test_cmd = NULL; /* + * Ask malloc() to map minimum-sized chunks of virtual address space at a time, + * so that mlockall() won't needlessly wire megabytes of unused memory into the + * process. This must be done using the malloc_conf string so that it gets set + * up before the first allocation, which happens before entry to main(). + */ +const char * malloc_conf = "lg_chunk:0"; + +/* * Periodically pat the watchdog, preventing it from firing. */ int @@ -188,7 +196,7 @@ watchdog_loop(void) if (watchdog_onoff(0) == 0) { end_program = 2; } else { - warnx("Could not stop the watchdog, not exiting"); + warnx("Could not stop the watchdog, not exitting"); end_program = 0; } } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"