[ruby-core:120336] [Ruby master Bug#20972] OpenSSL Memory Usage
From:
"mrkgrandjean (Mark Grandjean) via ruby-core" <ruby-core@...>
Date:
2024-12-19 22:20:17 UTC
List:
ruby-core #120336
Issue #20972 has been reported by mrkgrandjean (Mark Grandjean).
----------------------------------------
Bug #20972: OpenSSL Memory Usage
https://bugs.ruby-lang.org/issues/20972
* Author: mrkgrandjean (Mark Grandjean)
* Status: Open
* ruby -v: 3.3.6
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
While testing large file uploads I noticed the OpenSSL Buffering is allocating a lot of memory for file uploads.
Similar to the issue in this ticket from a few years ago https://bugs.ruby-lang.org/issues/14426
Using the same test code from that ticket
``` ruby
require "http"
require "memory_profiler"
require "stringio"
body = StringIO.new("a" * 5*1024*1024)
MemoryProfiler.report do
HTTP.post("https://example.com", body: body)
end.pretty_print
```
in ruby 2.6.10
```
allocated memory by gem
-----------------------------------
1913287 unicode_normalize
1053463 llhttp-ffi-0.5.0
187849 http-5.2.0
50168 openssl
36180 addressable-2.8.7
8904 ipaddr
272 other
```
While testing in Ruby 3.3.6
```
allocated memory by gem
-----------------------------------
16104976 openssl
2393456 unicode_normalize
1053880 llhttp-ffi-0.5.0
151633 http-5.2.0
9813 addressable-2.8.7
7872 ipaddr
240 other
40 forwardable
```
It looks like the memory allocation issue has returned.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/