You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/10/14 21:33:36 UTC

svn commit: r1022675 - in /subversion/trunk: ./ subversion/svnserve/main.c

Author: hwright
Date: Thu Oct 14 19:33:35 2010
New Revision: 1022675

URL: http://svn.apache.org/viewvc?rev=1022675&view=rev
Log:
Merge r982355 from the performance branch, which see for more information.

Modified:
    subversion/trunk/   (props changed)
    subversion/trunk/subversion/svnserve/main.c

Propchange: subversion/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 14 19:33:35 2010
@@ -23,7 +23,7 @@
 /subversion/branches/log-g-performance:870941-871032
 /subversion/branches/merge-skips-obstructions:874525-874615
 /subversion/branches/nfc-nfd-aware-client:870276,870376
-/subversion/branches/performance:983764,983766,984927,985014,985037,985046,985477,985669,987888,987893,995507,995603,1001413
+/subversion/branches/performance:982355,983764,983766,984927,985014,985037,985046,985477,985669,987888,987893,995507,995603,1001413
 /subversion/branches/ra_serf-digest-authn:875693-876404
 /subversion/branches/reintegrate-improvements:873853-874164
 /subversion/branches/subtree-mergeinfo:876734-878766

Modified: subversion/trunk/subversion/svnserve/main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnserve/main.c?rev=1022675&r1=1022674&r2=1022675&view=diff
==============================================================================
--- subversion/trunk/subversion/svnserve/main.c (original)
+++ subversion/trunk/subversion/svnserve/main.c Thu Oct 14 19:33:35 2010
@@ -372,6 +372,7 @@ int main(int argc, const char *argv[])
   apr_sockaddr_t *sa;
   apr_pool_t *pool;
   apr_pool_t *connection_pool;
+  apr_allocator_t *allocator;
   svn_error_t *err;
   apr_getopt_t *os;
   int opt;
@@ -794,10 +795,22 @@ int main(int argc, const char *argv[])
         return ERROR_SUCCESS;
 #endif
 
+      /* If we are using fulltext caches etc., we will allocate many large
+         chunks of memory of various sizes outside the cachde for those
+         fulltexts. Make sure, we use the memory wisely: use an allocator
+         that causes memory fragments to be given back to the OS early. */
+
+      if (apr_allocator_create(&allocator))
+        return EXIT_FAILURE;
+
+      apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
+
       /* Non-standard pool handling.  The main thread never blocks to join
          the connection threads so it cannot clean up after each one.  So
          separate pools, that can be cleared at thread exit, are used */
-      connection_pool = svn_pool_create(NULL);
+
+      connection_pool = svn_pool_create_ex(NULL, allocator);
+      apr_allocator_owner_set(allocator, connection_pool);
 
       status = apr_socket_accept(&usock, sock, connection_pool);
       if (handling_mode == connection_mode_fork)