Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: XML DomDocument  (Read 7112 times)
Jean G.
Posts: 15


« on: January 14, 2011, 04:05:26 pm »

Hi,

I am working on a program that creates several XML DomDocuments, opens and closes an XML reader and parses XML data into arrays. When I added the arrays I started getting out of memory errors when I run the programs.

Is the each XML DomDocument held in memory until the program exits, if so is there a way to release the DomDocument object. Something like when to close the reader or writer.

Thanks,
Jean
Jean G.
Posts: 15


« Reply #1 on: January 16, 2011, 06:06:38 pm »

Hi,

I found my out of memory problem. It was a dynamic array that I had added to store the parsed XML data. This is the code that gave me the problem.

FOR i = 1 to ga_xml_array.getLength()  -- it doesn't know the upper boundary, so just keeps running tell get the out of memory error. Kind of like an infinite loop

When I changed it to code below it worked find.

 LET counter = ga_xml_array.getLength()

 FOR i = 1 to counter

Still would like to know it there is a way release DomDocument before exiting the program.

Thanks,
Jean
Sisavanh S.
Four Js
Posts: 80


« Reply #2 on: January 17, 2011, 10:02:04 am »

Hi,

About the array count it is a quite strange behavior.
If you don't update the array count in your loop, there is no reason for going in infinite loop.

I suggest that you open an issue and provide a sample test program to your local support center.

About releasing DomDocument, you need to set it to NULL.
The document is released if there are no references to any of its nodes.

If you need more clarifications please contact your local support centers.

Many regards,
Sisa.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines