FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XML - Memory problem
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
XML - Memory problem
Posted: Wed Apr 22, 2015 08:03 AM
Hi,

I have a memory-problem if I read more then 35 XML-files.
Reading a few file's give no problem. Only a lot of files I get an error.

I get the error
Unrecoverable error 9006.
hb_xgrab can't allocate memory.

Is there something I have to close to solve this?
I already tried oMnuXml:end(), but that gives an error...

This is code:
Code (fw): Select all Collapse
FUNCTION lees_xml_file(file_name,totallines,naam,vtxt)

   local hFile      := FOpen( file_name )
   Local oMnuXml    := TXmlDocument():New( hFile )
   Local oXmlIter   := TXmlIterator():New( oMnuXml:oRoot ), oTagActual, cAttribute
   local vblockname := ''

   DO WHILE ( oTagActual := oXmlIter:Next() ) != nil
      IF otagActual:Depth() = 3
          ......
      ELSEIF otagActual:Depth() = 4
         IF upper(oTagActual:cName) = 'BLOCKNAME'
            vblockname = oTagActual:cData
         ELSEIF upper(oTagActual:cName) = 'ENTITYNAME'

         ......
         ENDIF
      ENDIF
   ENDDO

   oTagActual := nil
   FClose( hFile )
RETURN nil
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: XML - Memory problem
Posted: Wed Apr 22, 2015 08:45 AM
Hi,

I just test with only open the file's and close them, and I have also an error after calling this function 40 times...

Code (fw): Select all Collapse
FUNCTION lees_xml_file(file_name,totallines,naam,vtxt)

   local hFile      := FOpen( file_name )
   Local oMnuXml    := TXmlDocument():New( hFile )
   Local oXmlIter   := TXmlIterator():New( oMnuXml:oRoot ), oTagActual, cAttribute
   local vblockname := ''



   oTagActual := nil
   FClose( hFile )
RETURN nil
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: XML - Memory problem
Posted: Wed Apr 22, 2015 08:46 AM
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: XML - Memory problem
Posted: Wed Apr 22, 2015 12:08 PM
cnavarro wrote:Look

viewtopic.php?f=6&t=30059&hilit=xml#p171428


Thank you for the link.
Now its working!!
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite

Continue the discussion