You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Darwin MBP-von-Robert 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 arm64
Other relevant info you may wish to add:
Installed or activated gems: Running embedded in a Java process
Application/framework version (e.g. Rails, Sinatra): None
Environment variables: Nothing additional
I realized when trying to upgrade JRuby for AsciidoctorJ to the latest version 9.3.2.0 that the tests started failing with OutOfMemoryErrors. It most often failed when Asciidoctor tries to load a file with IO.read.
I could reproduce this to a smaller project without Asciidoctor at https://github.com/robertpanzer/asciidoctorj-jruby-test-posix-reproducer.
It looks like since JRuby 9.3.2.0 PosixShim.size does not return the correct file size anymore, but much higher values instead.
JRuby then allocates memory for the entire file, and that can fail.
The following screenshot shows that:
The file documentwithtoc.adoc has a size of 156 bytes. But PosixShim.size() returns 249568530 instead in this run. And a next run might for example return 654663914.
Expected Behavior
JRuby should only allocate the required memory when loading a small file.
This is also what I observe on JRuby 9.2.20.1
Actual Behavior
JRuby 9.3.2.0 allocates several 100MB even for loading a file with just 156 bytes.
The text was updated successfully, but these errors were encountered:
Environment Information
Provide at least:
uname -a
)Other relevant info you may wish to add:
I realized when trying to upgrade JRuby for AsciidoctorJ to the latest version 9.3.2.0 that the tests started failing with OutOfMemoryErrors. It most often failed when Asciidoctor tries to load a file with
IO.read
.I could reproduce this to a smaller project without Asciidoctor at https://github.com/robertpanzer/asciidoctorj-jruby-test-posix-reproducer.
It looks like since JRuby 9.3.2.0 PosixShim.size does not return the correct file size anymore, but much higher values instead.
JRuby then allocates memory for the entire file, and that can fail.
The following screenshot shows that:
The file documentwithtoc.adoc has a size of 156 bytes. But PosixShim.size() returns 249568530 instead in this run. And a next run might for example return 654663914.
Expected Behavior
JRuby should only allocate the required memory when loading a small file.
This is also what I observe on JRuby 9.2.20.1
Actual Behavior
JRuby 9.3.2.0 allocates several 100MB even for loading a file with just 156 bytes.
The text was updated successfully, but these errors were encountered: