You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/08/26 11:46:06 UTC

[11/26] couch commit: updated refs/heads/windsor-merge to 14dc5e9

Garbage collect OS process Pids

The amount of data flowing through these pids to the ports can cause a
significant amount of garbage to accumulate. This just reacts to a
request from the proc manager to occasionally garbage collect.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/245a683e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/245a683e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/245a683e

Branch: refs/heads/windsor-merge
Commit: 245a683e9c38caa1f303eac213dfc71d6adf9ac4
Parents: b72ae14
Author: Paul J. Davis <pa...@gmail.com>
Authored: Mon Aug 11 12:55:28 2014 -0500
Committer: Robert Newson <rn...@apache.org>
Committed: Tue Aug 26 10:44:12 2014 +0100

----------------------------------------------------------------------
 src/couch_os_process.erl | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/245a683e/src/couch_os_process.erl
----------------------------------------------------------------------
diff --git a/src/couch_os_process.erl b/src/couch_os_process.erl
index 676d540..8aaf5db 100644
--- a/src/couch_os_process.erl
+++ b/src/couch_os_process.erl
@@ -207,6 +207,9 @@ handle_cast({send, Data}, #os_proc{writer=Writer, idle=Idle}=OsProc) ->
             ?LOG_ERROR("Failed sending data: ~p -> ~p", [Data, OsError]),
             {stop, normal, OsProc}
     end;
+handle_cast(garbage_collect, #os_proc{idle=Idle}=OsProc) ->
+    erlang:garbage_collect(),
+    {noreply, OsProc, Idle};
 handle_cast(stop, OsProc) ->
     {stop, normal, OsProc};
 handle_cast(Msg, #os_proc{idle=Idle}=OsProc) ->