From 3593af16fc012d2cef846cc6a524288030d3c267 Mon Sep 17 00:00:00 2001 From: Matthew Sackman Date: Fri, 13 Aug 2010 12:44:49 +0100 Subject: Improvements to comments --- src/file_handle_cache.erl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl index 4ef5e29f..5b348580 100644 --- a/src/file_handle_cache.erl +++ b/src/file_handle_cache.erl @@ -137,6 +137,13 @@ -define(SERVER, ?MODULE). -define(RESERVED_FOR_OTHERS, 100). + +%% Googling around suggests that Windows has a limit somewhere around +%% 16M, eg +%% http://blogs.technet.com/markrussinovich/archive/2009/09/29/3283844.aspx +%% however, it turns out that's only available through the win32 +%% API. Via the C Runtime, we have just 512: +%% http://msdn.microsoft.com/en-us/library/6e3b887c%28VS.80%29.aspx -define(FILE_HANDLES_LIMIT_WINDOWS, 512). -define(FILE_HANDLES_LIMIT_OTHER, 1024). -define(FILE_HANDLES_CHECK_INTERVAL, 2000). @@ -820,12 +827,9 @@ maybe_reduce(State = #fhc_state { limit = Limit, count = Count, elders = Elders, maybe_reduce(State) -> State. -%% Googling around suggests that Windows has a limit somewhere around -%% 16M, eg -%% http://blogs.technet.com/markrussinovich/archive/2009/09/29/3283844.aspx -%% For everything else, assume ulimit exists. Further googling -%% suggests that BSDs (incl OS X), solaris and linux all agree that -%% ulimit -n is file handles +%% For all unices, assume ulimit exists. Further googling suggests +%% that BSDs (incl OS X), solaris and linux all agree that ulimit -n +%% is file handles ulimit() -> case os:type() of {win32, _OsName} -> -- cgit v1.2.1