RE: Xerces-C 2.9?

2008-02-27 Thread Sahoglu, Ozgur


Hi Boris,

Are we branching for 3.0 and 2.9? What is the version of the trunk?

Thank you,


-Ozgur Sahoglu

-Original Message-
From: Boris Kolpackov [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 25, 2008 10:18 AM
To: c-dev@xerces.apache.org
Subject: Re: Xerces-C 2.9?

Hi Jesse,

Jesse Pelton <[EMAIL PROTECTED]> writes:

> There have been a number of references to version 2.9 recently, mostly
> in bug reports that Alberto has modified.  Are there plans to do a 2.9
> release?  I thought 2.8 was intended to be the last of the 2.x
releases.
> Just curious whether that thinking has changed.

Xerces-C++ 3.0.0 has a number of backwards-incompatible changes that may
require fairly-substantial adjustments to code that uses Xerces-C++
2-series.
This is especially true for applications that rely on DOM. As a result,
there
will most likely be a number of applications that will have to stick
with
2-series. If there is demand for the bug-fix-only 2-series release from
the
community then we may decide to have 2.9.0.

Boris

-- 
Boris Kolpackov, Code Synthesis Tools
Open source XML data binding for C++:
http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing:
http://codesynthesis.com/products/xsde

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Problem with libtool convenience libraries (3.0.0)

2008-02-27 Thread Scott Cantor
> Hm, are we talking about the same thing here? Convenience libraries
> (in automake/libtool) are not installed. They just aggregate object
> files and are used as input when building the actual library/executable
> which is then installed:

Sorry, my confusion. I thought you meant the .la files in general, which
cause me pain thanks to -rpath.

-- Scott



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with libtool convenience libraries (3.0.0)

2008-02-27 Thread Boris Kolpackov
Hi Scott,

Scott Cantor <[EMAIL PROTECTED]> writes:

> How would you do it? I've never seen any way to avoid them, it's just part
> of libtool being libtool.

I would just have one library (libxerces-c.la) that will directly include
all the sources, something along these lines:

lib_LTLIBRARIES = libxerces-c.la
libxerces_c_la_SOURCES = xercesc/util/Base64.cpp ...

AUTOMAKE_OPTIONS = subdir-objects

Some of the sources should be included conditionally, but this won't be
a problem.

> I ask because they contain hardcoded paths to libraries prior to
> installation in some cases and I have to take extra steps to delete
> them in my projects.

Hm, are we talking about the same thing here? Convenience libraries
(in automake/libtool) are not installed. They just aggregate object
files and are used as input when building the actual library/executable
which is then installed:

http://sources.redhat.com/automake/automake.html#Libtool-Convenience-Libraries


Boris

-- 
Boris Kolpackov, Code Synthesis Tools
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Problem with libtool convenience libraries (3.0.0)

2008-02-27 Thread Scott Cantor
> Does anyone (James?) see any potential problems in getting rid of them?

How would you do it? I've never seen any way to avoid them, it's just part
of libtool being libtool.

I ask because they contain hardcoded paths to libraries prior to
installation in some cases and I have to take extra steps to delete them in
my projects.

-- Scott



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem with libtool convenience libraries (3.0.0)

2008-02-27 Thread Boris Kolpackov
Hi,

I just realized that the libtool/automake convenience libraries that
are heavily used in the new build system have one major drawback:
when both PIC and non-PIC objects are being built, the convenience
library only contains the PIC versions. As a result, later, when the
main library  (libxerces-c in our case) is built, these PIC objects
are used for both shared and static versions. This seems to me like
a bad way to do it: the code in the static version is slower than
it could be and a lot of time is wasted building the non-PIC objects
which are then simply thrown away.

I am by no means an autotools expert, but it appears that automake
can handle sources in different directories just fine. In fact,
sources for some of the convenience libraries are split into several
sub-directories and therefore already rely on this feature. I am then
wondering what is the purpose of all these convenience libraries? Since
all of them but one (libcompat.la) are built from a single makefile
(src/Makefile.am), there does not seem to be anything convenient about
them. They also have the big drawback mentioned above.

Does anyone (James?) see any potential problems in getting rid of them?
The only thing that I can think of is the command line length limit on
some platforms but then the build system in 2.x.y does not seem to have
this problem plus the ar command line has all the objects listed
explicitly.

Any feedback would be very much appreciated.


Boris

-- 
Boris Kolpackov, Code Synthesis Tools
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Please help me out with this code..Can i reuse DOM objects in a while loop??????

2008-02-27 Thread Jesse Pelton
Oops. Alberto already corrected the first point. I stand by the second,
though.



From: Jesse Pelton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 27, 2008 8:59 AM
To: c-dev@xerces.apache.org
Subject: RE: Please help me out with this code..Can i reuse DOM objects
in a while loop??


I haven't examined the reset code, but I'd expect the document to be
released when you reset the parser (unless you adopt the document via a
call to adoptDocument(), in which case it's your responsibility to
release it).
 
Given that you're processing huge files, you should consider using a SAX
parser. SAX is a stream-oriented interface. You install callbacks to
handle SAX events as the input is processed. You use the callbacks to
extract whatever information you need and store it however it makes
sense; the parser does not construct any representation of the document
itself. If you store the extracted data efficiently, this should require
much less memory than a DOM representing the entire document. In the
ideal case, you have chunks of data that can be processed and then
discarded; a SAX parser should be able to handle arbitrarily large
documents in this scenario, assuming the chunks aren't so big that they
exhaust memory.



From: Sree Harsha [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 26, 2008 10:20 PM
To: c-dev@xerces.apache.org
Subject: Re: Please help me out with this code..Can i reuse DOM objects
in a while loop??


Thanks for your reply, but still the memory consumption has not come
down. Is there any way i can reuse DOMDocument variable also like in the
following snippet...
 
do 
{ 

/*create a source file */ 

parser_.parse(source); //parser_ is a XercesDOMParser object 
 
xercesc::DOMDocument* xmlDoc = parser_.getDocument() ;

/*How to release the memory allocated to the DOMDocument pointer*/

/*parse the file source*/ 

/*delete the source file*/ 

/*I used the function which you suggested*/
 
parser_.reset();
 
/*still it takes up a lot of memory when parsing a big file*/

}while(dwbytes==bufsize); 
/*some condition*/ 

Finally I also have one more doubt... When we use DOM, the entire file
to be parsed is brought into the memory isnt it... Now if I have to
parse a large file, say 380 MB or 1GB, we cant Bring the entire file to
the memory. So I thought it would be better to split the file into
smaller sizes and parse them bit by bit (4K long)... that is the reason
i have used create source file in the above code
Am I in the Right path
 
On 2/26/08, Jesse Pelton <[EMAIL PROTECTED]> wrote: 

It looks to me like you could call the various
XercesDOMParser::reset...() and AbstractDOMParser::reset...() methods.
Or, to be paranoid and/or lazy, you could use a new parser for each
iteration.



From: Sree Harsha [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 26, 2008 5:40 AM
To: [EMAIL PROTECTED]; c-dev@xerces.apache.org
Subject: Please help me out with this code..Can i reuse DOM
objects in a while loop??

 


/*Can i reuse the DOM objects like XercesDOMParser object in a
do... while loop as follows or will it cause any memory leaks how to
reuse them...*/ 
do 
{ 

/*create a source file */ 

parser_.parse(source); //parser_ is a XercesDOMParser object 

/*parse the file source*/ 

/*delete the source file*/ 

/*what function should i call to reuse parser_ object in the
next iteration so that memory consumption reduces */

}while(dwbytes==bufsize); 
/*some condition*/ 


-- 
Regards
Sree Harsha Vardhana S.N
"When you want something, all the universe conspires in helping
you to
achieve it." 

-- 
Regards
Sree Harsha Vardhana S.N
"When you want something, all the universe conspires in helping
you to
achieve it." 




-- 
Regards
Sree Harsha Vardhana S.N
"When you want something, all the universe conspires in helping you to
achieve it." 


RE: Please help me out with this code..Can i reuse DOM objects in a while loop??????

2008-02-27 Thread Jesse Pelton
I haven't examined the reset code, but I'd expect the document to be
released when you reset the parser (unless you adopt the document via a
call to adoptDocument(), in which case it's your responsibility to
release it).
 
Given that you're processing huge files, you should consider using a SAX
parser. SAX is a stream-oriented interface. You install callbacks to
handle SAX events as the input is processed. You use the callbacks to
extract whatever information you need and store it however it makes
sense; the parser does not construct any representation of the document
itself. If you store the extracted data efficiently, this should require
much less memory than a DOM representing the entire document. In the
ideal case, you have chunks of data that can be processed and then
discarded; a SAX parser should be able to handle arbitrarily large
documents in this scenario, assuming the chunks aren't so big that they
exhaust memory.



From: Sree Harsha [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 26, 2008 10:20 PM
To: c-dev@xerces.apache.org
Subject: Re: Please help me out with this code..Can i reuse DOM objects
in a while loop??


Thanks for your reply, but still the memory consumption has not come
down. Is there any way i can reuse DOMDocument variable also like in the
following snippet...
 
do 
{ 

/*create a source file */ 

parser_.parse(source); //parser_ is a XercesDOMParser object 
 
xercesc::DOMDocument* xmlDoc = parser_.getDocument() ;

/*How to release the memory allocated to the DOMDocument pointer*/

/*parse the file source*/ 

/*delete the source file*/ 

/*I used the function which you suggested*/
 
parser_.reset();
 
/*still it takes up a lot of memory when parsing a big file*/

}while(dwbytes==bufsize); 
/*some condition*/ 

Finally I also have one more doubt... When we use DOM, the entire file
to be parsed is brought into the memory isnt it... Now if I have to
parse a large file, say 380 MB or 1GB, we cant Bring the entire file to
the memory. So I thought it would be better to split the file into
smaller sizes and parse them bit by bit (4K long)... that is the reason
i have used create source file in the above code
Am I in the Right path
 
On 2/26/08, Jesse Pelton <[EMAIL PROTECTED]> wrote: 

It looks to me like you could call the various
XercesDOMParser::reset...() and AbstractDOMParser::reset...() methods.
Or, to be paranoid and/or lazy, you could use a new parser for each
iteration.



From: Sree Harsha [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 26, 2008 5:40 AM
To: [EMAIL PROTECTED]; c-dev@xerces.apache.org
Subject: Please help me out with this code..Can i reuse DOM
objects in a while loop??

 


/*Can i reuse the DOM objects like XercesDOMParser object in a
do... while loop as follows or will it cause any memory leaks how to
reuse them...*/ 
do 
{ 

/*create a source file */ 

parser_.parse(source); //parser_ is a XercesDOMParser object 

/*parse the file source*/ 

/*delete the source file*/ 

/*what function should i call to reuse parser_ object in the
next iteration so that memory consumption reduces */

}while(dwbytes==bufsize); 
/*some condition*/ 


-- 
Regards
Sree Harsha Vardhana S.N
"When you want something, all the universe conspires in helping
you to
achieve it." 

-- 
Regards
Sree Harsha Vardhana S.N
"When you want something, all the universe conspires in helping
you to
achieve it." 




-- 
Regards
Sree Harsha Vardhana S.N
"When you want something, all the universe conspires in helping you to
achieve it." 


Re: Please help me out with this code..Can i reuse DOM objects in a while loop??????

2008-02-27 Thread Sree Harsha
/*Here is how the code looks like*/

XercesDOMParser parser_;

do
 {

/*code to create a source file */

/*During the next iteration the following code will give runtime error*/


parser_.parse(source);


xercesc::DOMDocument* xmlDoc = parser_.getDocument() ;

/*code to parse the file source*/


/*code to delete the source file*/

/*I used the function which you suggested*/

parser_.resetDocumentPool();

}while(dwbytes==bufsize);
 /*some condition*/


Re: Please help me out with this code..Can i reuse DOM objects in a while loop??????

2008-02-27 Thread Sree Harsha
XercesDOMParser parser_;

do
 {

/*create a source file */

/*During the next iteration the following code will give runtime error*/


parser_.parse(source);


xercesc::DOMDocument* xmlDoc = parser_.getDocument() ;

/*How to release the memory allocated to the DOMDocument pointer*/

/*parse the file source*/

/*delete the source file*/

/*I used the function which you suggested*/

parser_.resetDocumentPool();

}while(dwbytes==bufsize);
 /*some condition*/



On 2/27/08, Alberto Massari <[EMAIL PROTECTED]> wrote:
>
> Sree Harsha wrote:
> > Thanks Alberto,
> > I used resetDocumentPool(),
> > But I get a run time error R6025 pure virtual function call.
>
> When/where do you call resetDocumentPool? And where do you get the pure
> virtual function call? Are you attempting to access one of the DOM tree
> that you have just released?
>
> Alberto
>
> >
> > Thanks and regards
> > Sree Harsha Vardhana S.N
> >
> > On 2/27/08, *Alberto Massari* <[EMAIL PROTECTED]
> > > wrote:
> >
> > Hi Sree,
> > you should invoke resetDocumentPool(), not reset(). As for the
> > code you
> > posted previously, I noticed you were not releasing the transcoded
> > strings (you actually commented the call to XMLString::release):
> that
> > would be a substantial leak.
> > On the other hand, if you want to parse files so big, you should
> > investigate switching to SAX parsing.
> >
> > Alberto
> >
> > Sree Harsha wrote:
> > > Thanks for your reply, but still the memory consumption has not
> come
> > > down. Is there any way i can reuse DOMDocument variable also like
> in
> > > the following snippet...
> > >
> > > do
> > > {
> > >
> > > /*create a source file */
> > >
> > > parser_.parse(source); //parser_ is a XercesDOMParser object
> > >
> > > xercesc::DOMDocument* xmlDoc = parser_.getDocument() ;
> > >
> > > /*How to release the memory allocated to the DOMDocument pointer*/
> > >
> > > /*parse the file source*/
> > >
> > > /*delete the source file*/
> > >
> > > /*I used the function which you suggested*/
> > >
> > > parser_.reset();
> > >
> > > /*still it takes up a lot of memory when parsing a big file*/
> > >
> > > }while(dwbytes==bufsize);
> > > /*some condition*/
> > >
> > > Finally I also have one more doubt... When we use DOM, the
> > entire file
> > > to be parsed is brought into the memory isnt it... Now if I have
> to
> > > parse a large file, say 380 MB or 1GB, we cant Bring the entire
> file
> > > to the memory. So I thought it would be better to split the file
> > into
> > > smaller sizes and parse them bit by bit (4K long)... that is the
> > > reason i have used create source file in the above code
> > > Am I in the Right path
> > >
> > > On 2/26/08, *Jesse Pelton* <[EMAIL PROTECTED]  > PROTECTED]>
> > >> wrote:
> > >
> > > It looks to me like you could call the various
> > > XercesDOMParser::reset...() and AbstractDOMParser::reset...()
> > > methods. Or, to be paranoid and/or lazy, you could use a new
> > > parser for each iteration.
> > >
> > >
> >
> 
> > > *From:* Sree Harsha [mailto:[EMAIL PROTECTED]
> > 
> > >  > >]
> > > *Sent:* Tuesday, February 26, 2008 5:40 AM
> > > *To:* [EMAIL PROTECTED]
> >   > >;
> > > c-dev@xerces.apache.org 
> > >
> > > *Subject:* Please help me out with this code..Can i reuse DOM
> > > objects in a while loop??
> > >
> > >
> > > /*Can i reuse the DOM objects like XercesDOMParser object in a
> > > do... while loop as follows or will it cause any memory
> > leaks
> > > how to reuse them...*/
> > > do
> > > {
> > >
> > > /*create a source file */
> > >
> > > parser_.parse(source); //parser_ is a XercesDOMParser object
> > >
> > > /*parse the file source*/
> > >
> > > /*delete the source file*/
> > >
> > > /*what function should i call to reuse parser_ object in the
> > next
> > > iteration so that memory consumption reduces */
> > >
> > > }while(dwbytes==bufsize);
> > > /*some condition*/
> > >
> > >
> > > --
> > > Regards
> > > Sree Harsha Vardhana S.N
> > > "When you want something, all the universe conspires in
> > helping you to
> > > achieve it."
> > >

Re: Please help me out with this code..Can i reuse DOM objects in a while loop??????

2008-02-27 Thread Alberto Massari

Sree Harsha wrote:

Thanks Alberto,
I used resetDocumentPool(),
But I get a run time error R6025 pure virtual function call.


When/where do you call resetDocumentPool? And where do you get the pure 
virtual function call? Are you attempting to access one of the DOM tree 
that you have just released?


Alberto

 
Thanks and regards

Sree Harsha Vardhana S.N
 
On 2/27/08, *Alberto Massari* <[EMAIL PROTECTED] 
> wrote:


Hi Sree,
you should invoke resetDocumentPool(), not reset(). As for the
code you
posted previously, I noticed you were not releasing the transcoded
strings (you actually commented the call to XMLString::release): that
would be a substantial leak.
On the other hand, if you want to parse files so big, you should
investigate switching to SAX parsing.

Alberto

Sree Harsha wrote:
> Thanks for your reply, but still the memory consumption has not come
> down. Is there any way i can reuse DOMDocument variable also like in
> the following snippet...
>
> do
> {
>
> /*create a source file */
>
> parser_.parse(source); //parser_ is a XercesDOMParser object
>
> xercesc::DOMDocument* xmlDoc = parser_.getDocument() ;
>
> /*How to release the memory allocated to the DOMDocument pointer*/
>
> /*parse the file source*/
>
> /*delete the source file*/
>
> /*I used the function which you suggested*/
>
> parser_.reset();
>
> /*still it takes up a lot of memory when parsing a big file*/
>
> }while(dwbytes==bufsize);
> /*some condition*/
>
> Finally I also have one more doubt... When we use DOM, the
entire file
> to be parsed is brought into the memory isnt it... Now if I have to
> parse a large file, say 380 MB or 1GB, we cant Bring the entire file
> to the memory. So I thought it would be better to split the file
into
> smaller sizes and parse them bit by bit (4K long)... that is the
> reason i have used create source file in the above code
> Am I in the Right path
>
> On 2/26/08, *Jesse Pelton* <[EMAIL PROTECTED] 
>> wrote:
>
> It looks to me like you could call the various
> XercesDOMParser::reset...() and AbstractDOMParser::reset...()
> methods. Or, to be paranoid and/or lazy, you could use a new
> parser for each iteration.
>
>


> *From:* Sree Harsha [mailto:[EMAIL PROTECTED]

> >]
> *Sent:* Tuesday, February 26, 2008 5:40 AM
> *To:* [EMAIL PROTECTED]
 >;
> c-dev@xerces.apache.org 
>
> *Subject:* Please help me out with this code..Can i reuse DOM
> objects in a while loop??
>
>
> /*Can i reuse the DOM objects like XercesDOMParser object in a
> do... while loop as follows or will it cause any memory
leaks
> how to reuse them...*/
> do
> {
>
> /*create a source file */
>
> parser_.parse(source); //parser_ is a XercesDOMParser object
>
> /*parse the file source*/
>
> /*delete the source file*/
>
> /*what function should i call to reuse parser_ object in the
next
> iteration so that memory consumption reduces */
>
> }while(dwbytes==bufsize);
> /*some condition*/
>
>
> --
> Regards
> Sree Harsha Vardhana S.N
> "When you want something, all the universe conspires in
helping you to
> achieve it."
>
> --
> Regards
> Sree Harsha Vardhana S.N
> "When you want something, all the universe conspires in
helping you to
> achieve it."
>
>
>
>
> --
> Regards
> Sree Harsha Vardhana S.N
> "When you want something, all the universe conspires in helping
you to
> achieve it."



-
To unsubscribe, e-mail: [EMAIL PROTECTED]

For additional commands, e-mail: [EMAIL PROTECTED]





--
Regards
Sree Harsha Vardhana S.N
"When you want something, all the universe conspires in helping you to
achieve it." 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Please help me out with this code..Can i reuse DOM objects in a while loop??????

2008-02-27 Thread Sree Harsha
Thanks for the tip on releasing the XMLstring memory ... there was a
reduction in the use of memory...
please tell me why i am getting an error when i resetDocumentPool();
I get a run time error R6025 pure virtual function call
thank you

On 2/27/08, Sree Harsha <[EMAIL PROTECTED]> wrote:
>
> Thanks Alberto,
> I used resetDocumentPool(),
> But I get a run time error R6025 pure virtual function call.
>
> Thanks and regards
> Sree Harsha Vardhana S.N
>
>  On 2/27/08, Alberto Massari <[EMAIL PROTECTED]> wrote:
> >
> > Hi Sree,
> > you should invoke resetDocumentPool(), not reset(). As for the code you
> > posted previously, I noticed you were not releasing the transcoded
> > strings (you actually commented the call to XMLString::release): that
> > would be a substantial leak.
> > On the other hand, if you want to parse files so big, you should
> > investigate switching to SAX parsing.
> >
> > Alberto
> >
> > Sree Harsha wrote:
> > > Thanks for your reply, but still the memory consumption has not come
> > > down. Is there any way i can reuse DOMDocument variable also like in
> > > the following snippet...
> > >
> > > do
> > > {
> > >
> > > /*create a source file */
> > >
> > > parser_.parse(source); //parser_ is a XercesDOMParser object
> > >
> > > xercesc::DOMDocument* xmlDoc = parser_.getDocument() ;
> > >
> > > /*How to release the memory allocated to the DOMDocument pointer*/
> > >
> > > /*parse the file source*/
> > >
> > > /*delete the source file*/
> > >
> > > /*I used the function which you suggested*/
> > >
> > > parser_.reset();
> > >
> > > /*still it takes up a lot of memory when parsing a big file*/
> > >
> > > }while(dwbytes==bufsize);
> > > /*some condition*/
> > >
> > > Finally I also have one more doubt... When we use DOM, the entire file
> > > to be parsed is brought into the memory isnt it... Now if I have to
> > > parse a large file, say 380 MB or 1GB, we cant Bring the entire file
> > > to the memory. So I thought it would be better to split the file into
> > > smaller sizes and parse them bit by bit (4K long)... that is the
> > > reason i have used create source file in the above code
> > > Am I in the Right path
> > >
> > > On 2/26/08, *Jesse Pelton* <[EMAIL PROTECTED] > 
> > > wrote:
> > >
> > > It looks to me like you could call the various
> > > XercesDOMParser::reset...() and AbstractDOMParser::reset...()
> > > methods. Or, to be paranoid and/or lazy, you could use a new
> > > parser for each iteration.
> > >
> > >
> > 
> > > *From:* Sree Harsha [mailto:[EMAIL PROTECTED]
> > > ]
> > > *Sent:* Tuesday, February 26, 2008 5:40 AM
> > > *To:* [EMAIL PROTECTED] ;
> > > c-dev@xerces.apache.org 
> > > *Subject:* Please help me out with this code..Can i reuse DOM
> > > objects in a while loop??
> > >
> > >
> > > /*Can i reuse the DOM objects like XercesDOMParser object in a
> > > do... while loop as follows or will it cause any memory leaks
> > > how to reuse them...*/
> > > do
> > > {
> > >
> > > /*create a source file */
> > >
> > > parser_.parse(source); //parser_ is a XercesDOMParser object
> > >
> > > /*parse the file source*/
> > >
> > > /*delete the source file*/
> > >
> > > /*what function should i call to reuse parser_ object in the next
> > > iteration so that memory consumption reduces */
> > >
> > > }while(dwbytes==bufsize);
> > > /*some condition*/
> > >
> > >
> > > --
> > > Regards
> > > Sree Harsha Vardhana S.N
> > > "When you want something, all the universe conspires in helping
> > you to
> > > achieve it."
> > >
> > > --
> > > Regards
> > > Sree Harsha Vardhana S.N
> > > "When you want something, all the universe conspires in helping
> > you to
> > > achieve it."
> > >
> > >
> > >
> > >
> > > --
> > > Regards
> > > Sree Harsha Vardhana S.N
> > > "When you want something, all the universe conspires in helping you to
> > > achieve it."
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Regards
> Sree Harsha Vardhana S.N
> "When you want something, all the universe conspires in helping you to
> achieve it."
>



-- 
Regards
Sree Harsha Vardhana S.N
"When you want something, all the universe conspires in helping you to
achieve it."


Re: Please help me out with this code..Can i reuse DOM objects in a while loop??????

2008-02-27 Thread Sree Harsha
Thanks Alberto,
I used resetDocumentPool(),
But I get a run time error R6025 pure virtual function call.

Thanks and regards
Sree Harsha Vardhana S.N

On 2/27/08, Alberto Massari <[EMAIL PROTECTED]> wrote:
>
> Hi Sree,
> you should invoke resetDocumentPool(), not reset(). As for the code you
> posted previously, I noticed you were not releasing the transcoded
> strings (you actually commented the call to XMLString::release): that
> would be a substantial leak.
> On the other hand, if you want to parse files so big, you should
> investigate switching to SAX parsing.
>
> Alberto
>
> Sree Harsha wrote:
> > Thanks for your reply, but still the memory consumption has not come
> > down. Is there any way i can reuse DOMDocument variable also like in
> > the following snippet...
> >
> > do
> > {
> >
> > /*create a source file */
> >
> > parser_.parse(source); //parser_ is a XercesDOMParser object
> >
> > xercesc::DOMDocument* xmlDoc = parser_.getDocument() ;
> >
> > /*How to release the memory allocated to the DOMDocument pointer*/
> >
> > /*parse the file source*/
> >
> > /*delete the source file*/
> >
> > /*I used the function which you suggested*/
> >
> > parser_.reset();
> >
> > /*still it takes up a lot of memory when parsing a big file*/
> >
> > }while(dwbytes==bufsize);
> > /*some condition*/
> >
> > Finally I also have one more doubt... When we use DOM, the entire file
> > to be parsed is brought into the memory isnt it... Now if I have to
> > parse a large file, say 380 MB or 1GB, we cant Bring the entire file
> > to the memory. So I thought it would be better to split the file into
> > smaller sizes and parse them bit by bit (4K long)... that is the
> > reason i have used create source file in the above code
> > Am I in the Right path
> >
> > On 2/26/08, *Jesse Pelton* <[EMAIL PROTECTED] > 
> > wrote:
> >
> > It looks to me like you could call the various
> > XercesDOMParser::reset...() and AbstractDOMParser::reset...()
> > methods. Or, to be paranoid and/or lazy, you could use a new
> > parser for each iteration.
> >
> >
> 
> > *From:* Sree Harsha [mailto:[EMAIL PROTECTED]
> > ]
> > *Sent:* Tuesday, February 26, 2008 5:40 AM
> > *To:* [EMAIL PROTECTED] ;
> > c-dev@xerces.apache.org 
> > *Subject:* Please help me out with this code..Can i reuse DOM
> > objects in a while loop??
> >
> >
> > /*Can i reuse the DOM objects like XercesDOMParser object in a
> > do... while loop as follows or will it cause any memory leaks
> > how to reuse them...*/
> > do
> > {
> >
> > /*create a source file */
> >
> > parser_.parse(source); //parser_ is a XercesDOMParser object
> >
> > /*parse the file source*/
> >
> > /*delete the source file*/
> >
> > /*what function should i call to reuse parser_ object in the next
> > iteration so that memory consumption reduces */
> >
> > }while(dwbytes==bufsize);
> > /*some condition*/
> >
> >
> > --
> > Regards
> > Sree Harsha Vardhana S.N
> > "When you want something, all the universe conspires in helping you
> to
> > achieve it."
> >
> > --
> > Regards
> > Sree Harsha Vardhana S.N
> > "When you want something, all the universe conspires in helping you
> to
> > achieve it."
> >
> >
> >
> >
> > --
> > Regards
> > Sree Harsha Vardhana S.N
> > "When you want something, all the universe conspires in helping you to
> > achieve it."
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Regards
Sree Harsha Vardhana S.N
"When you want something, all the universe conspires in helping you to
achieve it."