• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Newbie question: DOM & memory requirements

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I'm a bit of a newbie to XML, and I was hoping someone could answer a question for me please. Is anyone aware of how much memory would be required to load say a 1MB XML file into the DOM? I'm sure it probably varies between parsers, but I would very much like to find out the memory overhead incurred in doing this. If anyone has any ideas I'd be very grateful!! Apologies if this has been asked before..
many thanks for all your help guys
cheers
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DOM parsing typically uses more memory than SAX parsing. This is because the parser creates a document representation in memory with all the nodes and cross references.
I do not have any parser specific statistics, but you should always consider DOM as an expensive parsing mechanism. The bigger the document size is, the more will be memory consumption and time required to parse.
Hope that helps.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic