![]() |
|
|
Issue Type:
|
Improvement
|
Assignee:
|
Thomas E Enebo
|
Created:
|
08/Nov/12 1:16 PM
|
Description:
|
It may be that the amount of input available to read is much smaller than n, but the current implementation will still result in a large amount of memory being pre-allocated. This presumably hurts performance. Simple demo:
irb(main):001:0> io = open('/dev/null')
=> #<File:/dev/null>
irb(main):002:0> io.readpartial(2**31-1)
Java::JavaLang::OutOfMemoryError: Requested array size exceeds VM limit
from org.jruby.util.ByteList.<init>(ByteList.java:91)
from org.jruby.util.io.ChannelStream.read(ChannelStream.java:853)
from org.jruby.util.io.ChannelStream.readpartial(ChannelStream.java:1335)
from org.jruby.RubyIO.getPartial(RubyIO.java:2768)
from org.jruby.RubyIO.readpartial(RubyIO.java:2723)
from org.jruby.RubyIO$INVOKER$i$0$1$readpartial.call(RubyIO$INVOKER$i$0$1$readpartial.gen)
from org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:642)
from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:204)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
from org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
from org.jruby.ast.RootNode.interpret(RootNode.java:129)
from org.jruby.evaluator.ASTInterpreter.INTERPRET_EVAL(ASTInterpreter.java:96)
from org.jruby.evaluator.ASTInterpreter.evalWithBinding(ASTInterpreter.java:175)
from org.jruby.RubyKernel.evalCommon(RubyKernel.java:1102)
from org.jruby.RubyKernel.eval19(RubyKernel.java:1065)
from org.jruby.RubyKernel$INVOKER$s$0$3$eval19.call(RubyKernel$INVOKER$s$0$3$eval19.gen)
from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:178)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:70)
from org.jruby.ast.FCallManyArgsNode.interpret(FCallManyArgsNode.java:60)
from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
from org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
from org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:112)
from org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:126)
from org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:167)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:70)
from org.jruby.ast.CallManyArgsNode.interpret(CallManyArgsNode.java:59)
from org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
from org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
from org.jruby.evaluator.ASTInte^Creter.INTERPRET_METHOD(ASTInterpreter.java:75)
|
Project:
|
JRuby
|
Priority:
|
Major
|
Reporter:
|
Jon Leighton
|
|
|
|
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email