ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:52069]  [Ruby master Bug#20311] Struct.new("A") memory leak?
@ 2024-02-28 12:03 MaxLap (Maxime Lapointe) via ruby-dev
  2024-02-28 13:28 ` [ruby-dev:52070] " byroot (Jean Boussier) via ruby-dev
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: MaxLap (Maxime Lapointe) via ruby-dev @ 2024-02-28 12:03 UTC (permalink / raw)
  To: ruby-dev; +Cc: MaxLap (Maxime Lapointe)

Issue #20311 has been reported by MaxLap (Maxime Lapointe).

----------------------------------------
Bug #20311: Struct.new("A") memory leak?
https://bugs.ruby-lang.org/issues/20311

* Author: MaxLap (Maxime Lapointe)
* Status: Open
* ruby -v: 3.3.0
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
The following code gives the impression of a memory leak.

```
10.times do
  5000.times do
    Struct.new("A")
    Struct.send(:remove_const, :A)
  end

  GC.start
  puts `ps -o rss= -p #{$$}`.to_i
end
```

```
27868
35324
43400
51472
58676
66144
73764
81196
88512
95752
```

Is there another location where the struct gets set that I need to clear up for the GC free the memory?

Happens in 3.2.2, 3.2.3, 3.3.0, 3.3-head, ruby-head.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-07-08  2:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-28 12:03 [ruby-dev:52069] [Ruby master Bug#20311] Struct.new("A") memory leak? MaxLap (Maxime Lapointe) via ruby-dev
2024-02-28 13:28 ` [ruby-dev:52070] " byroot (Jean Boussier) via ruby-dev
2024-02-28 16:36 ` [ruby-dev:52071] " nobu (Nobuyoshi Nakada) via ruby-dev
2024-02-29 11:45 ` [ruby-dev:52072] " byroot (Jean Boussier) via ruby-dev
2024-02-29 11:47 ` [ruby-dev:52073] " byroot (Jean Boussier) via ruby-dev
2024-02-29 12:07 ` [ruby-dev:52074] " byroot (Jean Boussier) via ruby-dev
2024-02-29 14:59 ` [ruby-dev:52075] " byroot (Jean Boussier) via ruby-dev
2024-03-01  6:03 ` [ruby-dev:52077] " nobu (Nobuyoshi Nakada) via ruby-dev
2024-03-01  7:01 ` [ruby-dev:52078] " nobu (Nobuyoshi Nakada) via ruby-dev
2024-03-01  7:23 ` [ruby-dev:52079] " byroot (Jean Boussier) via ruby-dev
2024-03-21  6:58 ` [ruby-dev:52081] " naruse (Yui NARUSE) via ruby-dev
2024-07-08  2:12 ` [ruby-dev:52092] " nagachika (Tomoyuki Chikanaga) via ruby-dev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).