]> granicus.if.org Git - apache/commitdiff
Merge r1201158 from trunk:
authorStefan Fritsch <sf@apache.org>
Sat, 12 Nov 2011 01:57:26 +0000 (01:57 +0000)
committerStefan Fritsch <sf@apache.org>
Sat, 12 Nov 2011 01:57:26 +0000 (01:57 +0000)
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
docs/conf/extra/httpd-mpm.conf.in
docs/manual/mod/mpm_common.xml
server/mpm_common.c

diff --git a/CHANGES b/CHANGES
index ed2d6611ec673cd2fc9e53738d76edf9290ac336..2f95c0a1a6058b19c8e1cfd17897314132a8da34 100644 (file)
--- 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.
index 3bd919a275dc59623cf8b5c08a3105c4e526680d..4286ded333eafcccf8313571f282ec580f85887d 100644 (file)
@@ -92,7 +92,6 @@
     MaxSpareThreads        250
     MaxThreads            1000
     MaxConnectionsPerChild   0
-    MaxMemFree             100
 </IfModule>
 
 # OS/2 MPM
     MaxConnectionsPerChild   0
 </IfModule>
 
+# 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.
+<IfModule !mpm_netware_module>
+    MaxMemFree            2048
+</IfModule>
+<IfModule mpm_netware_module>
+    MaxMemFree             100
+</IfModule>
index 3a5031628b86ac330c510832e2942de29cf2fdc8..e979555795d3f08e732376c74b37fe7862de5cb9 100644 (file)
@@ -327,7 +327,7 @@ simultaneously</description>
 <description>Maximum amount of memory that the main allocator is allowed
 to hold without calling <code>free()</code></description>
 <syntax>MaxMemFree <var>KBytes</var></syntax>
-<default>MaxMemFree 0</default>
+<default>MaxMemFree 2048</default>
 <contextlist><context>server config</context></contextlist>
 <modulelist><module>event</module><module>mpm_netware</module>
 <module>prefork</module><module>worker</module><module>mpm_winnt</module>
@@ -335,8 +335,9 @@ to hold without calling <code>free()</code></description>
 
 <usage>
     <p>The <directive>MaxMemFree</directive> directive sets the
-    maximum number of free Kbytes that the main allocator is allowed
-    to hold without calling <code>free()</code>. When not set, or when set
+    maximum number of free Kbytes that every allocator is allowed
+    to hold without calling <code>free()</code>. In threaded MPMs, every
+    thread has its own allocator. When not set, or when set
     to zero, the threshold will be set to unlimited.</p>
 </usage>
 </directivesynopsis>
index 3663167fc313330dbc352390f32775b81d49d910..d393ba60837b619eeafe0e30f761d42d663353e0 100644 (file)
@@ -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 */
 }