imap-over-ssl connections left to GC do not clean up completely
---------------------------------------------------------------
Key: JRUBY-5021
URL: http://jira.codehaus.org/browse/JRUBY-5021
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.5.1
Reporter: Charles Oliver Nutter
Assignee: Charles Oliver Nutter
Fix For: JRuby 1.5.2
This script leaks badly:
{noformat}
require 'net/imap'
10000.times.each do |i|
puts "connection #{i}"
imap = Net::IMAP.new('imap.gmail.com', 993, true)
imap.disconnect
end
{noformat}
JRUBY-5019 details how there's a bug in imap that leaves connections to be
GCed, rather than setting them to sync_close. The provided patch fixes this
issue, but there's a larger problem: these connections, left to GC, still seem
to live.
I traced through the heap and found that all the dangling sockets were being
held by ChannelDescriptor.filenoDescriptorMap, the map we use to associate
pseudo-fileno's with actual ChannelDescriptor instances. Normally this should
get cleaned out when the wrapping IO object finalizes or closes, but in this
case...that doesn't seem to be happening.
--
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