• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

SAX Out of Memory Exception in Java 6

 
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys : I recently found that SAX causes an out of memory error in Java 6 when working with large files !

It is documented here, but I dont see any workarounds !!!
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6536111

Does anybody know a good wway to parse large XML files using SAX in Java 6 !?
 
Sheriff
Posts: 28350
97
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The release notes for Java 6 Update 14 say they include a fix for this bug. So have you actually encountered this bug yourself, or are you just spreading rumours? The "workaround", if you can even call it that, is to install the current version of Java.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The server machine we're seeing this error has Java 6 update 21 on it, and unfortunately it's still occurring at about the same point even if we adjust the heap size so that it should theoretically be able to contain the 40GB file we're reading.
 
Paul Clapham
Sheriff
Posts: 28350
97
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's interesting. Of course you shouldn't get out-of-memory exceptions from a SAX parser under any circumstances (unless it's your code using up the memory)... but have you tried the same code with Java 5? From what I see, that didn't have the problem.
 
What's a year in metric? Do you know this metric stuff tiny ad?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic