# 1.8 NoMemoryError

**URL:** <https://www.ruby-forum.com/t/1-8-nomemoryerror/137722>\
**Category:** Development\
**Created:** [May 15, 2008, 6:22pm UTC](https://www.ruby-forum.com/t/1-8-nomemoryerror/137722 "2008-05-15T18:22:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [May 15, 2008, 6:22pm UTC](https://www.ruby-forum.com/t/1-8-nomemoryerror/137722/1 "2008-05-15T18:22:17Z")

</div>

1.8 e$B$G0J2\<$N$h$&$Ke(B NoMemoryError e$B$,=P$k$h$&$JG[Ns3NJ]$r7+$je(B  
e$BJV$79T$&$H!"e(B2e$B2s$a$G%W%m%;%9$,CfCG$7$^$9!#e(B

% limit addressspace 300m  
% ./ruby -ve ’  
4.times {|i|  
p i  
begin  
Array.new(1 \<\< 28)  
rescue NoMemoryError  
p $!  
end  
}’  
ruby 1.8.7 (2008-05-15 patchlevel 5000) [i686-linux]  
0  
#\<NoMemoryError: failed to allocate memory\>  
1  
[FATAL] failed to allocate memory  
zsh: exit 1 ./ruby -ve

1.9 e$B$G$O$=$&$$$&CfCG$O5/$3$j$^$;$s!#e(B

% ./ruby -ve ’  
4.times {|i|  
p i  
begin  
Array.new(1 \<\< 28)  
rescue NoMemoryError  
p $!  
end  
}’  
ruby 1.9.0 (2008-05-14 revision 16414) [i686-linux]  
0  
#\<NoMemoryError: failed to allocate memory\>  
1  
#\<NoMemoryError: failed to allocate memory\>  
2  
#\<NoMemoryError: failed to allocate memory\>  
3  
#\<NoMemoryError: failed to allocate memory\>

rubyspec e$B$re(B LP64 e$B$J%^%7%s$GF0$+$9$He(B (e$B$\*$=$i$/e(B)  
e$B$3$l$,860x$Ge(B  
e$BESCf$GCfCG$7$A$c$&$s$G$9$,!"e(B1.8 e$B$N5sF0$O0U?^$5$l$?$b$N$G$7$ge(B  
e$B$&$+!#e(B
