couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [40/50] couch commit: updated refs/heads/master to 9d0ac7d
Date Thu, 28 Aug 2014 12:12:16 GMT
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/9393328f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/9393328f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/9393328f

Branch: refs/heads/master
Commit: 9393328f013e0c7c70b5194f92f9b8c40c690963
Parents: da2ba9d
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Mon Aug 11 12:55:28 2014 -0500
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Aug 28 13:00:02 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/9393328f/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) ->


Mime
View raw message