Hi John, thank you very much for your suggestion. I think i will try the SAX-Parser.
Best regards, Mirko -------- Original-Nachricht -------- > Datum: Tue, 22 Sep 2009 14:50:54 -0400 > Von: John Lilley <[email protected]> > An: "[email protected]" <[email protected]> > Betreff: RE: method startElement() from class DOMLSParserFilter > Some suggestions... if you do not require the DOM itself, you might use > the SAX parser interface. It is not really much harder than the DOM > interface although it takes some getting used to the method-callback > mechanism. > Alternatively, if it is OK to use the memory temporarily, you could > deep-copy the filtered DOM to a new DOM and discard the original. > > john > > -----Original Message----- > From: Alberto Massari [mailto:[email protected]] > Sent: Tuesday, September 22, 2009 12:41 PM > To: [email protected] > Subject: Re: method startElement() from class DOMLSParserFilter > > Hi Mirko, > sorry for the late answer; the DOM document is reusing that text > fragment, but it doesn't try to use it for a similarly sized string. So, > it gets reused immediately, maybe to store just a couple of characters > (and that doesn't help reducing the memory footprint). > > Alberto > > Mirko Braun wrote: > > Hi Alberto, > > > > did you have the time to check "if node texts do the same > > with the buffer used to keep the node value, and how they are recycled > > (i.e. if the big buffer used by DATA nodes is reused for a much smaller > > node)"? > > > > Mirko > > > > -------- Original-Nachricht -------- > > > >> Datum: Tue, 08 Sep 2009 09:37:52 +0200 > >> Von: Alberto Massari <[email protected]> > >> An: [email protected] > >> Betreff: Re: method startElement() from class DOMLSParserFilter > >> > > > > > >> When you call release() on a node, the node is not deleted (as its > >> memory comes from a pool that can be deleted as a whole) but it's > placed > >> in a "recycle bin" from where it is taken when a new node of the same > >> type is requested. So, the next element will not allocate extra memory, > >> but reuse that node. What I need to check is if node texts do the same > >> with the buffer used to keep the node value, and how they are recycled > >> (i.e. if the big buffer used by DATA nodes is reused for a much smaller > >> node) > >> > >> Alberto > >> > >> Mirko Braun wrote: > >> > >>> Sorry, I don't know how much memory is used. I just had a look at the > >>> maximum used memory in the task manager (Window XP). It doesn't > >>> matter if i used a DOMLSParserFilter or not the process DOMPrint.exe > >>> > >> used the same size of memory. > >> > >>> The XML-Elements DATA which i want to reject have very large values > >>> and i think if i reject these nodes they are also removed from > >>> memory. Does "be marked for recycling" mean, that these DATA nodes > >>> remain in memory? > >>> > >>> Mirko > >>> > >>> -------- Original-Nachricht -------- > >>> > >>> > >>>> Datum: Mon, 07 Sep 2009 09:26:05 +0200 > >>>> Von: Alberto Massari <[email protected]> > >>>> An: [email protected] > >>>> Betreff: Re: method startElement() from class DOMLSParserFilter > >>>> > >>>> > >>> > >>> > >>>> Mirko Braun wrote: > >>>> > >>>> > >>>>> Hi Alberto, > >>>>> > >>>>> thank you very much for your help. I integrated the patch in > >>>>> 3.0.1 and it worked. There is no exception any more. > >>>>> But there is still one problem. The usage of memory is still > >>>>> of the same size. I think if a node is rejected from the tree > >>>>> the usage of memory should also decrease. Is my conclusion > >>>>> correct? > >>>>> > >>>>> > >>>>> > >>>> Yes, if a node is rejected is should be marked for recycling; how > much > >>>> memory are you seeing is been used? > >>>> > >>>> Alberto > >>>>
