Project

General

Profile

Actions

Bug #10537

closed

Repeated creation and garbage collection of WeakRef instances against a single object leaks memory

Added by javawizard (Alex Boyd) about 10 years ago. Updated almost 10 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0dev (2014-11-24 trunk 48552) [x86_64-darwin14]
[ruby-core:66428]

Description

require 'weakref'
a = Object.new
1_000_000.times do
  WeakRef.new a
end
GC.start

The above results in Ruby consuming ~150 MB of RAM, all of which can only be freed by dropping a. This should not be the case - an object being weakly referenced should not itself hold a reference to the WeakRef (or any associated data) pointing at it.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #10618: TestWeakRef#test_repeated_object_leak fails on ARMClosednormalperson (Eric Wong)12/18/2014Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0