• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML -30 mb file

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is XML the right technology to transfer files of the order of 30 mb. I am designing an app, that has to transform a 30 mb text file to an XML file. And I am running into all kind of memory issues. I tried toying with the jvm heap size by Xmx67108864. But it doesn't help either. I tried a DOM parser and then a SAX parser and everthing failed. So, what is the solution.
Thanks
Chirag
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
xml is only a temporary stored file, i thought.Just like order,bill,etc.
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Generally XML should be used for small amounts of data, with references to large (binary for example) data.
XML tends to be very inefficient when compared to binary formats, and relies on the fact that modern machines are massivley powerful, and we dont often care about the use of a few exter processor cycles.
If you genuinely have 30Meg of well formed XML text (rather than a large single piece of data in <data>data</data> tags of some kind) then perhaps you should split into multiple files and link them with references.

James
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not surprised you are facing memory issues because 30MB is not by any means a size of a typical XML file. The parser performance degrades with the increase in size of the XML file. Among the parsers themselves, you will see SAX parsers perform quite well when compared with DOM parsers as they don't have to maintain an in-memory image of the XML tree.
If your requirement is to deal with such large XML files, then think of writing a "feeder" framework that walks through big chunks of the input XML stream and feeds them to the parser. Ofcourse with such an additional layer, it may not be trivial to handle validation, cross references etc.

------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.
Co-author of Java 2 Certification Passport
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic