java - XML DOM Parsing using Flyweight Design -


processing xml documents in java using dom can overly memory intensive document contain large number of repetitive nodes, attributes, or values.

does know of java xml dom api leverages flyweight-pattern internally keep memory footprint minimum ? maybe configurable / enable / disable ?

did mean flyweight pattern? or did think lazy loading (or maybe "lazy parsing")? using flyweight pattern require parser recognize elements have same content (and structure). time consuming operation (and fear, space consuming also). additionally, @ depth should parser begin recognize flyweights?

in fact, can't imagine there dom parser recognizing flyweights. , there no dom parser using lazy loading. nature of dom: parse whole xml file , produce data structure highly flexible , random navigation.

maybe indeed switch streaming process using sax or stax. of course lose ability of flexible , random navigation, must process elements "on fly".

however, there parser called vtd-xml. developped memory efficiency in mind. loads whole xml file memory , provides methods navigating through elements. warned: navigation complicated , not intuitive (due nature of memory efficient storing). maybe use.


Comments