Project

General

Profile

Actions

Bug #1164

closed

1.9/windows memroy leak with rand() AND inspect

Added by raubarede (regis d'aubarede) about 15 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32]
Backport:
[ruby-core:22184]

Description

=begin

Here is my codes. memory jump far away with ruby 1.9.1, stable with 1.8.6

seems that a issue arrive when inspect() AND rand() are call in the same function (?!)

$MAXC=500
def test1 ss=[] ; 0.upto($MAXC) {|j| ss << j }; ss.inspect ; end
def test2 ss=[] ; 0.upto($MAXC) {|j| ss << jrand() }; end
def test3 ss=[] ; 0.upto($MAXC) {|j| ss << rand() }; ss.inspect ; end # bug
def test4 ss=[] ; 0.upto($MAXC) {|j| ss << rand() }; end
def test5 ss=[] ; 0.upto(1000
$MAXC) {|j| rand() } end
def test6 ss=[] ; 0.upto(1000*$MAXC) {|j| rand().inspect } end # bug
def test7 ss=[] ; 0.upto(1000*$MAXC) {|j| j.inspect } end

puts RUBY_VERSION
notest=7
notest==1 && 0.upto(100010001000) { test1 } # ok
notest==2 && 0.upto(100010001000) { test2 } # ok
notest==3 && 0.upto(100010001000) { test3 } # >>>> bug 1.9.1
notest==4 && 0.upto(100010001000) { test4 } # ok
notest==5 && 0.upto(100010001000) { test5 } # ok
notest==6 && 0.upto(100010001000) { test6 } # >>>> bug 1.9.1
notest==7 && 0.upto(100010001000) { test7 } # ok
=end


Files

ml.rb (920 Bytes) ml.rb raubarede (regis d'aubarede), 02/16/2009 09:17 PM
Actions #1

Updated by nobu (Nobuyoshi Nakada) about 15 years ago

=begin
Hi,

At Mon, 16 Feb 2009 21:17:55 +0900,
regis d'aubarede wrote in [ruby-core:22184]:

Here is my codes. memory jump far away with ruby 1.9.1, stable with 1.8.6

seems that a issue arrive when inspect() AND rand() are call in the same function (?!)

I tried it with 1.9.1dev but memory usage displayed by
ProcessManager was stable. How did you observe it?

--
Nobu Nakada

=end

Actions #2

Updated by usa (Usaku NAKAMURA) about 15 years ago

  • Assignee set to usa (Usaku NAKAMURA)

=begin
can reproduce in this code:
loop{0.0.inspect}

this problem seems to occur only when ruby is compiled with VC6.
so, it maybe compilers problem.
=end

Actions #3

Updated by usa (Usaku NAKAMURA) about 15 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r22471.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0