[#121498] [Ruby Bug#21210] IO::Buffer gets invalidated on GC compaction — "hanazuki (Kasumi Hanazuki) via ruby-core" <ruby-core@...>

Issue #21210 has been reported by hanazuki (Kasumi Hanazuki).

10 messages 2025/04/01

[#121519] [Ruby Bug#21214] VmRSS consumption increase in Ruby 3.4.2 vs Ruby 3.3.6 — "mood_vuadensl (LOIC VUADENS) via ruby-core" <ruby-core@...>

Issue #21214 has been reported by mood_vuadensl (LOIC VUADENS).

9 messages 2025/04/02

[#121542] [Ruby Bug#21217] Integer.sqrt produces wrong results even on input <= 1e18 — "hjroh0315 (Matthew Roh) via ruby-core" <ruby-core@...>

Issue #21217 has been reported by hjroh0315 (Matthew Roh).

8 messages 2025/04/06

[#121551] [Ruby Feature#21219] `Object#inspect` accept a list of instance variables to display — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>

Issue #21219 has been reported by byroot (Jean Boussier).

10 messages 2025/04/07

[#121556] [Ruby Bug#21220] Memory corruption in update_line_coverage() [write at index -1] — "mbcodeandsound (Mike Bourgeous) via ruby-core" <ruby-core@...>

Issue #21220 has been reported by mbcodeandsound (Mike Bourgeous).

16 messages 2025/04/07

[#121560] [Ruby Feature#21221] Proposal to upstream ZJIT — "maximecb (Maxime Chevalier-Boisvert) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxMjIxIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IG1heGltZWNiIChNYXhpbWUgQ2hldmFs

8 messages 2025/04/07

[#121565] [Ruby Feature#21254] Inlining Class#new — "tenderlovemaking (Aaron Patterson) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxMjU0IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHRlbmRlcmxvdmVtYWtpbmcgKEFhcm9u

12 messages 2025/04/07

[#121601] [Ruby Feature#21258] Retire CGI library from Ruby 3.5 — "hsbt (Hiroshi SHIBATA) via ruby-core" <ruby-core@...>

Issue #21258 has been reported by hsbt (Hiroshi SHIBATA).

11 messages 2025/04/09

[#121621] [Ruby Feature#21262] Proposal: `Ractor::Port` — "ko1 (Koichi Sasada) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxMjYyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGtvMSAoS29pY2hpIFNhc2FkYSkuDQoN

8 messages 2025/04/10

[#121627] [Ruby Feature#21264] Extract Date library from Ruby repo in the future — "hsbt (Hiroshi SHIBATA) via ruby-core" <ruby-core@...>

Issue #21264 has been reported by hsbt (Hiroshi SHIBATA).

8 messages 2025/04/11

[#121686] [Ruby Feature#21274] Show performance warnings for easily avoidable unnecessary implicit splat allocations — "jeremyevans0 (Jeremy Evans) via ruby-core" <ruby-core@...>

Issue #21274 has been reported by jeremyevans0 (Jeremy Evans).

6 messages 2025/04/18

[#121700] [Ruby Feature#21279] Bare "rescue" should not rescue NameError — "AMomchilov (Alexander Momchilov) via ruby-core" <ruby-core@...>

Issue #21279 has been reported by AMomchilov (Alexander Momchilov).

9 messages 2025/04/21

[#121702] [Ruby Bug#21280] StringIO#set_encoding warns when backed by chilled string literal — "jeremyevans0 (Jeremy Evans) via ruby-core" <ruby-core@...>

Issue #21280 has been reported by jeremyevans0 (Jeremy Evans).

13 messages 2025/04/22

[#121721] [Ruby Bug#21283] Some tests of TestMkmfConvertible is failing with VS2022 17.14.0 preview 4.0 — "hsbt (Hiroshi SHIBATA) via ruby-core" <ruby-core@...>

Issue #21283 has been reported by hsbt (Hiroshi SHIBATA).

8 messages 2025/04/24

[#121745] [Ruby Bug#21286] Windows - MSYS2 just updated to GCC 15.1.0, builds failing — "MSP-Greg (Greg L) via ruby-core" <ruby-core@...>

Issue #21286 has been reported by MSP-Greg (Greg L).

15 messages 2025/04/27

[#121755] [Ruby Misc#21290] Unable to build ruby extension on Fedora 42 due to possible GCC 15 issues — "lukef (Luke Freeman) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxMjkwIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGx1a2VmIChMdWtlIEZyZWVtYW4pLg0K

8 messages 2025/04/28

[ruby-core:121519] [Ruby Bug#21214] VmRSS consumption increase in Ruby 3.4.2 vs Ruby 3.3.6

From: "mood_vuadensl (LOIC VUADENS) via ruby-core" <ruby-core@...>
Date: 2025-04-02 16:06:55 UTC
List: ruby-core #121519
Issue #21214 has been reported by mood_vuadensl (LOIC VUADENS).

----------------------------------------
Bug #21214: VmRSS consumption increase in Ruby 3.4.2 vs Ruby 3.3.6
https://bugs.ruby-lang.org/issues/21214

* Author: mood_vuadensl (LOIC VUADENS)
* Status: Open
* ruby -v: ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
Hello,

After updating Ruby from 3.3.6 to 3.4.2, our batch-style (not based on rails) application exceed its memory limit.
Below is an example script that runs on both versions and demonstrates that 'ObjectSpace.memsize_of_all' does not vary significantly, but the OS 'VmRSS' increases significantly.

Do you have any information on what might have caused this increase or any lead to reduce this peak?

Here is the result on a Linux 5.15.167.4-microsoft-standard-WSL2:
with Ruby 3.3.6:
```text
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [x86_64-linux]
On start on 3.3.6
- OS VmRSS:        20628 kB
- ObjectSpace.memsize_of_all: 1.73MB

 On first full workload: 0
- OS VmRSS:       521504 kB
- ObjectSpace.memsize_of_all: 289.74MB

....
After workload
- OS VmRSS:       573484 kB
- ObjectSpace.memsize_of_all: 251.59MB

After data released
- OS VmRSS:       487404 kB
- ObjectSpace.memsize_of_all: 1.73MB
```
and 3.4.2:
```text
ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [x86_64-linux]
On start on 3.4.2
- OS VmRSS:        13132 kB
- ObjectSpace.memsize_of_all: 1.71MB

 On first full workload: 0
- OS VmRSS:       612508 kB
- ObjectSpace.memsize_of_all: 315.47MB

....
After workload
- OS VmRSS:       725356 kB
- ObjectSpace.memsize_of_all: 251.57MB


After data released
- OS VmRSS:       616364 kB
- ObjectSpace.memsize_of_all: 1.71MB
```

and the associated script:
```ruby
require 'objspace'

BYTES_TO_MB = 1024 * 1024

$stdout.sync = true
srand(1)

# Declare supporting code
def print_info(context)
  puts context
  GC.start

  os_mem_metric = File.readlines("/proc/#{Process.pid}/status").find { |line| line.start_with?('VmRSS:') }
  puts "- OS #{os_mem_metric}"
  puts "- ObjectSpace.memsize_of_all: #{(ObjectSpace.memsize_of_all.to_f/BYTES_TO_MB).round(2)}MB"
  puts ''
end

def random_string = Array.new(10) { rand(99) }.join

class A
  def initialize
    @a = random_string
    @b = rand(1000000000000)
  end
end


# Main
print_info "On start on #{RUBY_VERSION}"

objects = Array.new(1_000_000) { A.new }
hashes =  Array.new(250_000) { { a: rand(100_000), b: rand(100_000), c: random_string } }
arrays =  Array.new(250_000) { [rand(100_000), rand(100_000), random_string] }

keep_if = ->(index) { index.even? }
0.upto(3) do |i_loop|
  objects = objects.map.with_index { |obj, index| keep_if.call(index) ? obj : A.new }
  hashes = hashes.map.with_index { |obj, index| keep_if.call(index) ? obj : { a: rand(10_000), b: rand(10_000) } }
  arrays = arrays.map.with_index { |obj, index| keep_if.call(index) ? obj : [rand(10_000), rand(10_000)] }

  print_info " On first full workload: #{i_loop}" if i_loop.zero?

  keep_if = ->(index) { index.odd? } if i_loop == 1
  keep_if = ->(index) { index%5 == 0 } if i_loop == 2
  keep_if = ->(index) { index.even? } if i_loop == 3
  print '.'
end
puts ''

print_info 'After workload'

objects.clear
hashes.clear
arrays.clear

print_info 'After data released'
```

Regards




-- 
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/


In This Thread

Prev Next