Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

How to convert huge xml file into Jtree

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi

We get XML files(where registry information is converted into XML file) from clients since we can't access their machines.
We search the required information from those XML files manually.
I want to develop a tool that converts XML file(usually 90mb) into tree structure(just like registry information).
I tried using Apache Xerces parser , JDOM, DOM API.But iam getting "java.lang.OutOfMemoryError: Java heap space"
.
please guide me in developing this tool.

Thanks,
Lakshmi

 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Lakshmi,

Welcome to JavaRanch!

Well, to solve the immediate problem, SAX parsers use much less memory than DOM parsers, since they don't build a whole tree in memory, so you could use SAX instead.

Do you know about the -XmxNNm command line switch to tell Java to use more memory?

But of course, since your whole problem is that the DOM tree is too large to fit in memory, it's likely that a naive JTree is going to be too large to work well, either. You are probably going to need to think of ways to break the data up into smaller chunks.
 
Lakshmi Parimi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ernest,

First of all thanks a lot for your reply..

Yes ..i already tried to increase memory up to 1gb using -Xms1024M still i was getting same error.

Iam trying to convert xml to jtree using SAX API and using StAX API also in parallel.

Thanks once again..
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic