[ruby-core:65312] [ruby-trunk - Feature #10295] [PATCH] io.c (fptr_finalize): free memory (before GC sweep)

From: ko1@...
Date: 2014-09-29 07:44:12 UTC
List: ruby-core #65312
Issue #10295 has been updated by Koichi Sasada.


+1.


----------------------------------------
Feature #10295: [PATCH] io.c (fptr_finalize): free memory (before GC sweep)
https://bugs.ruby-lang.org/issues/10295#change-49132

* Author: Eric Wong
* Status: Open
* Priority: Low
* Assignee: 
* Category: core
* Target version: current: 2.2.0
----------------------------------------
Note: just committed r47712 which was trivial.
This passes tests, too, but I would appreciate another set of eyes
in case there's a subtle finalization issue I'm missing.

This releases memory on explict calls to rb_io_close,
reducing pressure on the GC.

Final massif snapshot shows reduced heap usage after RubyGems load
(valgrind --tool=massif ./ruby -e exit)

before:
	mem_heap_B=4821992
	mem_heap_extra_B=1302952

after:
	mem_heap_B=4791056
	mem_heap_extra_B=1192440


---Files--------------------------------
0001-io.c-fptr_finalize-free-memory-before-GC-sweep.patch (1.16 KB)


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

In This Thread

Prev Next