Project

General

Profile

Actions

Backport #3309

closed

net/http calls leak memory and file handles in windows

Added by phiggins (Pete Higgins) almost 14 years ago. Updated almost 5 years ago.

Status:
Closed
[ruby-core:30290]

Description

=begin
net/http calls leak memory and file handles in windows, and I've created a minimal script that demonstrates this.

When running the script, in between when the "before" and "after" lines are printed, Windows' Task Manager will show an increase in the Handles and Mem Usage columns. The amount of increase depends on the version of ruby used.

I've tested this on Windows XP with these versions of ruby:
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]
ruby 1.9.1p424 (2010-05-03 revision 27598) [i386-mingw32]
ruby 1.9.3dev (2010-05-18 trunk 27874) [i386-mingw32]

More discussion of this issue occurred on the RubyInstaller mailing list in this thread:
http://groups.google.com/group/rubyinstaller/browse_frm/thread/6bc9871f4a9f079
=end


Files

test_get.rb (189 Bytes) test_get.rb Leak demo using Net::HTTP.get_response. phiggins (Pete Higgins), 05/18/2010 09:45 AM
Actions #1

Updated by rogerdpack (Roger Pack) almost 14 years ago

=begin
for me, ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] definitely does leak file handles, and
ruby 1.9.3dev (2010-05-14) [i386-mingw32]
doesn't seem to (constant at 70, even if I put a loop around the get_content call, with and without GC).
If that helps at all :)

-rp
=end

Actions #2

Updated by rogerdpack (Roger Pack) over 13 years ago

=begin
Anybody know which commit may have fixed this in trunk? (net/http leaking handles in windows)?
Thanks.
=end

Actions #3

Updated by nobu (Nobuyoshi Nakada) over 13 years ago

=begin
Hi,

At Wed, 4 Aug 2010 01:25:10 +0900,
Roger Pack wrote in [ruby-core:31606]:

Anybody know which commit may have fixed this in trunk? (net/http leaking handles in windows)?

Maybe r27042?

--
Nobu Nakada

=end

Actions #4

Updated by nahi (Hiroshi Nakamura) over 13 years ago

  • Assignee set to nahi (Hiroshi Nakamura)

=begin

=end

Actions #5

Updated by nahi (Hiroshi Nakamura) over 13 years ago

  • Category set to core
  • Assignee changed from nahi (Hiroshi Nakamura) to yugui (Yuki Sonoda)

=begin
Confirmed. I agree that r27042 fixed this issue. ruby_1_9_2 is safe, too.

Yugui: please apply r27042 to 1.9.1.
=end

Actions #6

Updated by shyouhei (Shyouhei Urabe) over 13 years ago

  • Status changed from Open to Assigned

=begin

=end

Actions #7

Updated by jeremyevans0 (Jeremy Evans) almost 5 years ago

  • Description updated (diff)
  • Status changed from Assigned to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0