SSLSocket holds selectors, keys, preventing quick cleanup of resources when 
dereferenced
----------------------------------------------------------------------------------------

                 Key: JRUBY-5018
                 URL: http://jira.codehaus.org/browse/JRUBY-5018
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby-OSSL 0.7.1
            Reporter: Charles Oliver Nutter
            Assignee: Thomas E Enebo


SSLSocket currently opens three selectors immediately on creation, registering 
selection keys with each right away. This was probably done to avoid 
reconstructing the selectors for each read operation. This is unfortunately 
rather inefficient; the three selectors each consume three file descriptors, 
and because they all register selection keys immediately they don't get 
collected until the sun.nio.ch.SocketChannelImpl they're associated with gets 
finalized. Under heavy load, with many sockets created and thrown away, this 
can quickly eat up all available file descriptors for a process.

I'm working on a fix at the moment; I will simply accept the hit of doing a 
Selector.open each time a selection operation is required, which will reduce 
the amount of descriptors left hanging by 90%. The remaining descriptor (that 
for the socket itself) will eventually get collected.

I'll also look into whether we can forcibly clean up the socket in case of a 
dropped connection.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to