• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

JDOM parsing and memory

 
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(billFile);
Element root = doc.getRootElement();

I am trying to parse an xml file using JDOM. I am using above lines to create the document from billFile which is a File object. At this point,
doc is in memory. Does it means it holds entire document in memory or it only holds some information, pulls it as and when required.
please clarify
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's all in memory. In other words, holding a reference to a JDOM document built from an XML file of 3 megabytes will take at least 3 megabytes of memory ("at least" because the object structure takes more space than the raw data).
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There will be no reference in this case. Everything will be stored in memory.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!