httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1705922 - in /httpd/httpd/trunk: CHANGES server/mpm/event/event.c server/mpm/event/fdqueue.c server/mpm/event/fdqueue.h
Date Tue, 29 Sep 2015 20:16:47 GMT
Author: sf
Date: Tue Sep 29 20:16:47 2015
New Revision: 1705922

URL: http://svn.apache.org/viewvc?rev=1705922&view=rev
Log:
When shutting down a process, free resources early

Due to lingering connections, shutting down a process may take a very
long time. Free all recycled pools early in the hope that we can already
give some memory back to the OS.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/server/mpm/event/event.c
    httpd/httpd/trunk/server/mpm/event/fdqueue.c
    httpd/httpd/trunk/server/mpm/event/fdqueue.h

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1705922&r1=1705921&r2=1705922&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Sep 29 20:16:47 2015
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mpm_event: Free memory earlier when shutting down processes.
+     [Stefan Fritsch]
+
   *) mod_ssl: Make the output filter more friendly with deferred write and
      response pipelining. [Yann Ylavic, Joe Orton]
 

Modified: httpd/httpd/trunk/server/mpm/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1705922&r1=1705921&r2=1705922&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/event/event.c Tue Sep 29 20:16:47 2015
@@ -1282,6 +1282,8 @@ static void close_listeners(int process_
         }
         /* wake up the main thread */
         kill(ap_my_pid, SIGTERM);
+
+        ap_free_idle_pools(worker_queue_info);
     }
 }
 

Modified: httpd/httpd/trunk/server/mpm/event/fdqueue.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/fdqueue.c?rev=1705922&r1=1705921&r2=1705922&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/fdqueue.c (original)
+++ httpd/httpd/trunk/server/mpm/event/fdqueue.c Tue Sep 29 20:16:47 2015
@@ -277,6 +277,19 @@ void ap_pop_pool(apr_pool_t ** recycled_
     }
 }
 
+void ap_free_idle_pools(fd_queue_info_t *queue_info)
+{
+    apr_pool_t *p;
+
+    queue_info->max_recycled_pools = 0;
+    do {
+        ap_pop_pool(&p, queue_info);
+        if (p != NULL)
+            apr_pool_destroy(p);
+    } while (p != NULL);
+}
+
+
 apr_status_t ap_queue_info_term(fd_queue_info_t * queue_info)
 {
     apr_status_t rv;

Modified: httpd/httpd/trunk/server/mpm/event/fdqueue.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/fdqueue.h?rev=1705922&r1=1705921&r2=1705922&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/fdqueue.h (original)
+++ httpd/httpd/trunk/server/mpm/event/fdqueue.h Tue Sep 29 20:16:47 2015
@@ -52,6 +52,7 @@ apr_status_t ap_queue_info_wait_for_idle
                                           int *had_to_block);
 apr_status_t ap_queue_info_term(fd_queue_info_t * queue_info);
 apr_uint32_t ap_queue_info_get_idlers(fd_queue_info_t * queue_info);
+void ap_free_idle_pools(fd_queue_info_t *queue_info);
 
 struct fd_queue_elem_t
 {



Mime
View raw message