From aeaf18b96f2986d7faf8e00af7cf8d35dcac9e2d Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 12 Nov 2011 01:57:26 +0000 Subject: [PATCH] Merge r1201158 from trunk: Set MaxMemFree 2048 by default git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1201161 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 2 ++ docs/conf/extra/httpd-mpm.conf.in | 11 ++++++++++- docs/manual/mod/mpm_common.xml | 7 ++++--- server/mpm_common.c | 4 +++- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index ed2d6611ec..2f95c0a1a6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache 2.3.16 + *) core: Set MaxMemFree 2048 by default. [Stefan Fritsch] + *) mpm_event: Fix assertion failure during very high load. [Stefan Fritsch] *) configure: Additional modules loaded by default: mod_headers. diff --git a/docs/conf/extra/httpd-mpm.conf.in b/docs/conf/extra/httpd-mpm.conf.in index 3bd919a275..4286ded333 100644 --- a/docs/conf/extra/httpd-mpm.conf.in +++ b/docs/conf/extra/httpd-mpm.conf.in @@ -92,7 +92,6 @@ MaxSpareThreads 250 MaxThreads 1000 MaxConnectionsPerChild 0 - MaxMemFree 100 # OS/2 MPM @@ -116,3 +115,13 @@ MaxConnectionsPerChild 0 +# The maximum number of free Kbytes that every allocator is allowed +# to hold without calling free(). In threaded MPMs, every thread has its own +# allocator. When not set, or when set to zero, the threshold will be set to +# unlimited. + + MaxMemFree 2048 + + + MaxMemFree 100 + diff --git a/docs/manual/mod/mpm_common.xml b/docs/manual/mod/mpm_common.xml index 3a5031628b..e979555795 100644 --- a/docs/manual/mod/mpm_common.xml +++ b/docs/manual/mod/mpm_common.xml @@ -327,7 +327,7 @@ simultaneously Maximum amount of memory that the main allocator is allowed to hold without calling free() MaxMemFree KBytes -MaxMemFree 0 +MaxMemFree 2048 server config eventmpm_netware preforkworkermpm_winnt @@ -335,8 +335,9 @@ to hold without calling free()

The MaxMemFree directive sets the - maximum number of free Kbytes that the main allocator is allowed - to hold without calling free(). When not set, or when set + maximum number of free Kbytes that every allocator is allowed + to hold without calling free(). In threaded MPMs, every + thread has its own allocator. When not set, or when set to zero, the threshold will be set to unlimited.

diff --git a/server/mpm_common.c b/server/mpm_common.c index 3663167fc3..d393ba6083 100644 --- a/server/mpm_common.c +++ b/server/mpm_common.c @@ -147,6 +147,8 @@ int ap_graceful_shutdown_timeout; AP_DECLARE_DATA apr_uint32_t ap_max_mem_free; apr_size_t ap_thread_stacksize; +#define ALLOCATOR_MAX_FREE_DEFAULT (4096*1024) + /* Set defaults for config directives implemented here. This is * called from core's pre-config hook, so MPMs which need to override * one of these should run their pre-config hook after that of core. @@ -158,7 +160,7 @@ void mpm_common_pre_config(apr_pool_t *pconf) apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir)); ap_coredumpdir_configured = 0; ap_graceful_shutdown_timeout = 0; /* unlimited */ - ap_max_mem_free = APR_ALLOCATOR_MAX_FREE_UNLIMITED; + ap_max_mem_free = ALLOCATOR_MAX_FREE_DEFAULT; ap_thread_stacksize = 0; /* use system default */ } -- 2.40.0