Navigation Menu

Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nokogiri::XML::Reader broken (as a pull parser) on jruby - reads the whole XML document #831

Closed
ghost opened this issue Jan 11, 2013 · 3 comments

Comments

@ghost
Copy link

ghost commented Jan 11, 2013

$ ruby -v
jruby 1.6.7.2 (ruby-1.8.7-p357) (2012-05-01 26e08ba) (OpenJDK 64-Bit Server VM 1.6.0_24) [linux-amd64-java]

$ gem list | grep nokogiri
nokogiri (1.5.6 java)

$ ruby -e 'f = open("test.xml", "w"); f.write("<root>"); (10**8).times{ f.write("<nil/>")}; f.write("</root>"); f.close'

$ ls -lh test.xml
-rw-rw-r-- 1 test test 573M jan 11 12:08 test.xml

$ time ruby -rubygems -e 'require "nokogiri";Nokogiri::XML::Reader.from_io open("test.xml", "r")'
Error: Your application used more memory than the safety cap of 500M.
Specify -J-Xmx####m to increase it (#### = cap size in MB).
Specify -w for full OutOfMemoryError stack trace

real    0m2.950s
user    0m5.640s
sys 0m0.156s

$ rvm use system
$ ruby -v
ruby 1.9.3p327 (2012-11-10) [x86_64-linux] Brightbox

$ gem list | grep nokogiri
nokogiri (1.5.6)

$ time ruby -rubygems -e 'require "nokogiri";Nokogiri::XML::Reader.from_io open("test.xml", "r")'

real    0m0.075s
user    0m0.068s
sys 0m0.004s
@jvshahid
Copy link
Member

This issues turned to be much harder to fix. My test fooled my into thinking that the issue was fixed, when it wasn't. I'm working on the fix, reopening the issues until the fix is ready.

@jvshahid jvshahid reopened this Jan 12, 2013
@jvshahid jvshahid reopened this Jan 12, 2013
jvshahid added a commit that referenced this issue Jan 13, 2013
@johnsinco
Copy link

Hi. Is this fixed? I'm not really sure from the comments. We ran into this issue a year ago and had to parse our xml data by hand with string parsing, It'd be great to use Nokogiri for this. Do you think it should work on any jruby version? (1.9.3 mode) Thanks!

@jvshahid
Copy link
Member

Yes, it should work. The changes aren't released yet, but you can use the pre release version 1.5.7.rc3. If you're still having problems, feel free to open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants