Combination of Array#zip and Array#cycle result in OOM #482

Closed
isaiah opened this Issue Jan 7, 2013 · 3 comments

Projects

None yet

3 participants

@isaiah
Contributor
isaiah commented Jan 7, 2013
irb(main):001:0> [1,2].zip([0].cycle)
Java::JavaLang::OutOfMemoryError: Java heap space

while enumerator version

[1,2].to_enum.zip([0].cycle)

works fine.

@BanzaiMan
Member
[1,2].to_enum.zip([0].cycle)

results in OOM for me.

@nirvdrum
Contributor
nirvdrum commented Jan 7, 2013

The to_enum variant returns very quickly for me. JRuby 1.7.2. Java(TM) SE Runtime Environment (build 1.7.0_10-b18)

@BanzaiMan
Member

Oops. I forgot #to_enum somehow. I apologize for the noise there.

@isaiah isaiah pushed a commit to isaiah/jruby that referenced this issue Jan 7, 2013
Isaiah Peng resolve github #482 Array#zip with infinite enum results in OOM 18aac56
@isaiah isaiah pushed a commit to isaiah/jruby that referenced this issue Jan 8, 2013
Isaiah Peng regression test for gh #482 7c86c13
@isaiah isaiah pushed a commit to isaiah/jruby that referenced this issue Jan 9, 2013
Isaiah Peng fix grammar & typo in gh-482 regression spec 22c0cf4
@BanzaiMan BanzaiMan closed this in b0a6a92 Jan 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment