[ruby-core:116015] [Ruby master Bug#20149] Fix memory leak in IPSocket rb_getaddrinfo

Issue #20149 has been reported by HParker (Adam Hess). ---------------------------------------- Bug #20149: Fix memory leak in IPSocket rb_getaddrinfo https://bugs.ruby-lang.org/issues/20149 * Author: HParker (Adam Hess) * Status: Open * Priority: Normal * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- PR: https://github.com/ruby/ruby/pull/9413 Fixes a memory leak pthread_attr is created, but never cleaned up ``` require 'socket' 10.times do 10_000.times do IPSocket.getaddress("localhost") end puts `ps -o rss= -p #{$$}` end ``` before: ``` 26744 33400 39928 46328 53240 59640 66168 72696 79352 85880 ``` after: ``` 20864 20864 20864 20864 20864 20992 20992 20992 20992 21120 ``` This likely needs a backport to Ruby 3.3 series. -- https://bugs.ruby-lang.org/

Issue #20149 has been updated by naruse (Yui NARUSE). Backport changed from 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED to 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE ruby_3_3 2886564279dff87a6c293f6e80436eb2b309967e merged revision(s) 6aacbd690ccde53f9b97c6673482cb11df3f2955. ---------------------------------------- Bug #20149: Fix memory leak in IPSocket rb_getaddrinfo https://bugs.ruby-lang.org/issues/20149#change-106556 * Author: HParker (Adam Hess) * Status: Closed * Priority: Normal * Backport: 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE ---------------------------------------- PR: https://github.com/ruby/ruby/pull/9413 Fixes a memory leak pthread_attr is created, but never cleaned up ``` require 'socket' 10.times do 10_000.times do IPSocket.getaddress("localhost") end puts `ps -o rss= -p #{$$}` end ``` before: ``` 26744 33400 39928 46328 53240 59640 66168 72696 79352 85880 ``` after: ``` 20864 20864 20864 20864 20864 20992 20992 20992 20992 21120 ``` This likely needs a backport to Ruby 3.3 series. -- https://bugs.ruby-lang.org/
participants (2)
-
HParker (Adam Hess)
-
naruse (Yui NARUSE)