Rubymine + nokogiri + debug=? out of memory issue

1. evn =
pc => Windows 7 64bit, 4GB RAM, Corei5 CPU
build =>#RM-97.133
rubymine => 3.0.1
ruby =>   1.9.2p136 (2010-12-25) [i386-mingw32]
gems =>

*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.4, 3.0.3)
actionpack (3.0.4, 3.0.3)
activemodel (3.0.4, 3.0.3)
activerecord (3.0.4, 3.0.3)
activeresource (3.0.4, 3.0.3)
activesupport (3.0.4, 3.0.3)
addressable (2.2.4)
archive-tar-minitar (0.5.2)
arel (2.0.8, 2.0.7)
builder (2.1.2)
bundler (1.0.10)
capistrano (2.5.19)
columnize (0.3.2)
data_objects (0.10.3)
datamapper (1.0.2)
diff-lcs (1.1.2)
dm-aggregates (1.0.2)
dm-constraints (1.0.2)
dm-core (1.0.2)
dm-do-adapter (1.0.2)
dm-migrations (1.0.2)
dm-mysql-adapter (1.0.2)
dm-serializer (1.0.2)
dm-timestamps (1.0.2)
dm-transactions (1.0.2)
dm-types (1.0.2)
dm-validations (1.0.2)
do_mysql (0.10.3 x86-mingw32)
erubis (2.6.6)
extlib (0.9.15)
fastercsv (1.5.4)
git (1.2.5)
highline (1.6.1)
hoe (2.9.1)
i18n (0.5.0)
jeweler (1.5.2)
json (1.5.1 x86-mingw32)
json_pure (1.5.1)
linecache19 (0.5.11)
mail (2.2.15)
mime-types (1.16)
minitest (1.6.0)
mysql2 (0.2.6 x86-mingw32)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.1.0)
net-ssh-gateway (1.0.1)
nokogiri ( x86-mingw32)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.7)
rails (3.0.4, 3.0.3)
railties (3.0.4, 3.0.3)
rake (0.8.7)
rake-compiler (0.7.6)
rdiscount (1.6.8)
rdoc (2.5.8)
rspec (2.5.0)
rspec-core (2.5.1)
rspec-expectations (2.5.0)
rspec-mocks (2.5.0)
rspec-rails (2.5.0)
ruby-debug-base19 (0.11.25.jb3, 0.11.24)
ruby-debug-ide (0.4.15)
ruby-debug19 (0.11.6)
ruby_core_source (0.1.4)
rubygems-update (1.5.2)
sinatra (1.1.2)
stringex (1.1.0)
syntax (1.0.0)
syntaxi (0.5.0)
thor (0.14.6)
tilt (1.2.2)
treetop (1.4.9)
tzinfo (0.3.24)
uuidtools (2.1.2)
webrat (0.7.3)
yard (0.6.4)

2. I am trying to parse some .xml file (~1mb) with nokogiri. Doing something very simple:

require 'rubygems'
require 'nokogiri'

doc = Nokogiri::XML.parse('C:\projects\customer.xml'))

Trying to debug everything is fine for few moments, i.e. I can watch doc, but after few seconds I get this:

Ignore doesn't do anything. I always need to shutdown.
There is the problem?

Thank you.

Comment actions Permalink

Please add -XX:+HeapDumpOnOutOfMemoryError option into rubymine.exe.vmoptions file and upload memory snapshot to . Probably RubyMine gets extremely large value from the XML file and tries to show it in the debugger. How large is the XML file you are trying to process?

Comment actions Permalink

Hi Serge,
thanks for reply.
I've added -XX:+HeapDumpOnOutOfMemoryError into rubymine.exe.vmoptions file and followed instructions from here, but it seems I am missing something because I can not locate any .hrpof files on my machine. What do I do wrong here?

> Probably RubyMine gets extremely large value from the XML file and tries to show it in the debugger. How large is the XML file you are trying to process?
How large is extremely large? The xml file is 1,270,319 bytes and doesn't look too large.

Thank you

Comment actions Permalink

Try to capture memory snapshot using YourKit instead.

Comment actions Permalink

Filename java_pid5600.hprof.
Thank you

Comment actions Permalink

We don't see your snapshot. Are you sure it was uploaded properly?

Comment actions Permalink

Ups. Sorry.
I thought it went through, but just notoced that this file is 606 MB and obviously there is no chance it would upload that quick.
It this size normal? Do you want me to upload 606 MB?


Comment actions Permalink

You can lower xmx setting to get smaller dump.

Comment actions Permalink

Ok, lowered xmx from 1024 to 256 and got 96MB dump.
file name: java_pid2388.hprof
Uploading now.

Comment actions Permalink

I've just noticed that .nprof contains data from .xml I'm working on in plain text, which I can't send over.
Is there something particular you need to see from this dump? Or how I can remove this sensitive data from this dump?

Thank you.

Comment actions Permalink

I don't think you can remove your data from the snapshot.

Comment actions Permalink

Ok. Got some dummy xml. Still the same OOM error.
dump file name: java_pid6756.hprof

Uploading now.

Comment actions Permalink

FileZilla show I have a successfull transfer, but .uploads directory is empty. So I suppose you got it.

Comment actions Permalink

Thanks, please also file a bug at to track the progress.


Please sign in to leave a comment.