Feature #2837

Compile-time constant for HEAP_GROWTH_FACTOR (patch attached)

Added by Michael Edgar about 4 years ago. Updated about 1 year ago.

[ruby-core:28487]
Status:Closed
Priority:Normal
Assignee:Narihiro Nakamura
Category:core
Target version:next minor

Description

=begin
The GC currently increases the size at which newly-created heaps by a factor of 1.8 for each heap. Some find it appropriate to modify this value (REE uses a value of 1 instead of 1.8, for example). In the trunk version of this code, that value is hard-coded in as a constant at 1.8 in gc.c:980.

I've included a patch to expose this as a compile-time constant (HEAPGROWFACTOR), and also included getters and setters in the style of the patch I submitted in Issue 1047: http://redmine.ruby-lang.org/issues/show/1047 .
=end

grow_factor.patch Magnifier (2 KB) Michael Edgar, 03/05/2010 05:20 AM


Related issues

Related to ruby-trunk - Feature #8015: [patch] tuneable HEAP_GROWTH_FACTOR Closed 03/05/2013

History

#1 Updated by Nobuyoshi Nakada about 4 years ago

=begin
Hi,

At Fri, 5 Mar 2010 05:20:36 +0900,
Michael Edgar wrote in :

I've included a patch to expose this as a compile-time
constant (HEAPGROWFACTOR), and also included getters and
setters in the style of the patch I submitted in Issue 1047:
http://redmine.ruby-lang.org/issues/show/1047 .

At least, they must be members of rbobjspacet, and the
argument ranges should be checked.

--
Nobu Nakada

=end

#2 Updated by Michael Edgar about 4 years ago

=begin

At least, they must be members of rbobjspacet, and the
argument ranges should be checked.

I considered this, though they are compile-time constants that are being replaced. Pre-patch, they aren't currently in the rbobjspacet. The malloclimit accessor affects the currently rbobjspacet as appropriate, but the HEAPMINSLOTS accessors don't since that value doesn't directly affect existing structures. I can certainly put a heapminslots member into rbobjspace_t.

Also, which argument ranges are considered valid? Perhaps a malloc_limit of at least 10K? I don't know how small of a footprint Ruby could fit into that people would like. While most people increase these values beyond their initial defaults, I wouldn't want to set the limit too low.

Thanks!
=end

#3 Updated by Kazuhiro NISHIYAMA about 4 years ago

  • Target version set to 2.0.0

=begin

=end

#4 Updated by Hiroshi Nakamura about 2 years ago

  • Description updated (diff)
  • Assignee set to Narihiro Nakamura

#5 Updated by Shyouhei Urabe about 2 years ago

  • Status changed from Open to Assigned

#6 Updated by Narihiro Nakamura over 1 year ago

  • Target version changed from 2.0.0 to next minor

#7 Updated by Nobuyoshi Nakada about 1 year ago

This patch contains not only the subject but also the accessors.
It isn't acceptable and you should separate them, I think.

#8 Updated by Narihiro Nakamura about 1 year ago

  • Status changed from Assigned to Closed

I commited r39746.
We can change HEAPGROWTHFACTOR via an enviroment variable now.
So I close this ticket.

Thanks.

Also available in: Atom PDF