Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

New IO subsystem eagerly allocates requested size for IO#read #1833

headius opened this Issue Jul 19, 2014 · 1 comment


None yet
2 participants

headius commented Jul 19, 2014

With the new IO logic port, if you do io.read(1_000_000_000) it will attempt to eagerly allocate a byte[] that's one billion bytes wide. MRI does the same logic, but due to malloc tricks the unused portion of that buffer is never actually reserved from main memory. We don't have that option since all our arrays come from the JVM heap.

I am working on fixes on the https://github.com/jruby/jruby/tree/dynbuf_io branch.

@headius headius added this to the JRuby 9000 milestone Jul 19, 2014

@headius headius self-assigned this Jul 19, 2014


headius commented Jul 19, 2014

First attempt committed in 80cf81f.

@enebo enebo modified the milestone: JRuby Jul 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment