FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Error Irrecuperable 9009 ( Solucion en 32bits )
Posts: 230
Joined: Thu Sep 17, 2015 11:40 PM

Error Irrecuperable 9009 ( Solucion en 32bits )

Posted: Mon Jun 03, 2024 03:07 PM

Saludos estoy trabajando con unas tablas de 131884 registro llega un momento de haber realizado el proceso en 18793 registro q sale este error

hb_xrealloc no puede reubicar la memoria

alguna sugerencia para evitarlo . Gracias

Carlos Atuncar - CaSoftSystem
Chincha - Per煤
+51983478218
carlosalbatun@gmail.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Error Irrecuperable 9009

Posted: Mon Jun 03, 2024 03:33 PM

Est谩s usando Harbour 贸 xHarbour ?

Que versi贸n ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM

Re: Error Irrecuperable 9009

Posted: Mon Jun 03, 2024 03:41 PM
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 230
Joined: Thu Sep 17, 2015 11:40 PM

Re: Error Irrecuperable 9009

Posted: Mon Jun 03, 2024 04:07 PM

Windows 10

xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914)

RAM 16

WaitOn("Espere, recogiendo informacion...",@oWait )

FWCONNECT lServer HOST cServer ;

              USER cUser ;

              PASSWORD cPassword ;

              DATABASE cDBName

CheckConect()

cMsg := "SELECT * FROM personal_mov p WHERE fecha='2030-03-04'"// LIMIT 2000"

cQry := aServer:Query( cMsg )

nnc := 1

While !cQry:Eof()

oWait:Say(1,3,"Espere, actualizando Reg.: "+Alltrim( Str( cQry:id ) )+" -- "+Alltrim(Str(nnc))+Space(40) )

SysRefresh()

cMsg := "SELECT * FROM personal_mov WHERE id = "+ClipValue2Sql( cQry:id )

aQry := lServer:Query( cMsg )

If aQry:lastrec()>0

  oWait:Say(1,3,"Espere, actualizando Reg.: "+Alltrim( Str( cQry:id ) )+" -- "+Alltrim(Str(nnc))+" ok..."+Space(30) )

  SysRefresh()



  cMsg := "update personal_mov set "

  cMsg += "idasistencia = "+ClipValue2Sql( aQry:idasistencia )

  cMsg += ",idempresa = "+ClipValue2Sql( aQry:idempresa )

  cMsg += ",idfundo = "+ClipValue2Sql( aQry:idfundo )

  cMsg += ",campana = "+ClipValue2Sql( aQry:campana )

  cMsg += ",semana = "+ClipValue2Sql( aQry:semana )

  cMsg += ",tipo = "+ClipValue2Sql( aQry:tipo )

  cMsg += ",idpersonal = "+ClipValue2Sql( aQry:idpersonal )

  cMsg += ",fecha = "+ClipValue2Sql( aQry:fecha )

  cMsg += ",idparcela = "+ClipValue2Sql( aQry:idparcela )

  cMsg += ",idlote = "+ClipValue2Sql( aQry:idlote )

  cMsg += ",idlabor = "+ClipValue2Sql( aQry:idlabor )+" "

  cMsg += "WHERE id="+ClipValue2Sql( aQry:id )

  aServer:Execute( cMsg )

EndIf

aQry:End()

cQry:Skip()

nnc++

EndDo

cQry:End()

lServer:End()

Carlos Atuncar - CaSoftSystem
Chincha - Per煤
+51983478218
carlosalbatun@gmail.com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM

Re: Error Irrecuperable 9009

Posted: Mon Jun 03, 2024 04:33 PM
https://forums.fivetechsupport.com/viewtopic.php?f=16&t=33542&start=150&sid=77a99a8f21618266f2ba063d93794c5f#p269473

Carlos: Prueba y comente, pls.
Code (fw): Select all Collapse
FUNCTION ATUAL_REG()

聽 聽HB_GCALL( .F. )

聽 聽WaitOn( "Espere, recogiendo informacion...", @oWait )

聽 聽FWCONNECT lServer HOST cServer ;
聽 聽 聽 USER cUser 聽 聽 聽 聽 聽 聽 聽 聽 聽;
聽 聽 聽 PASSWORD cPassword 聽 聽 聽 聽 聽;
聽 聽 聽 DATABASE cDBName


聽 聽CheckConect()

聽 聽cMsg := "SELECT * FROM personal_mov p WHERE fecha='2030-03-04'"// LIMIT 2000"
聽 聽cQry := aServer:Query( cMsg )

聽 聽nnc := 1

聽 聽WHILE .NOT. cQry:Eof()

聽 聽 聽 SYSREFRESH()

聽 聽 聽 SYSWAIT( 3.5 ) // Delay aqui.

聽 聽 聽 HB_GCALL( .F. )

聽 聽 聽 oWait:Say( 1, 3, "Espere, actualizando Reg.: " + AllTrim( Str( cQry:id ) ) + " -- " + AllTrim( Str( nnc ) ) + Space( 40 ) )

聽 聽 聽 cMsg := "SELECT * FROM personal_mov WHERE id = " + ClipValue2Sql( cQry:id )

聽 聽 聽 aQry := lServer:Query( cMsg )

聽 聽 聽 IF aQry:LastRec() > 0

聽 聽 聽 聽 聽oWait:Say( 1, 3, "Espere, actualizando Reg.: " + AllTrim( Str( cQry:id ) ) + " -- " + AllTrim( Str( nnc ) ) + " ok..." + Space( 30 ) )

聽 聽 聽 聽 聽// SysRefresh()

聽 聽 聽 聽 聽cMsg := "update personal_mov set "
聽 聽 聽 聽 聽cMsg += "idasistencia = " + ClipValue2Sql( aQry:idasistencia )
聽 聽 聽 聽 聽cMsg += ",idempresa = " + ClipValue2Sql( aQry:idempresa )
聽 聽 聽 聽 聽cMsg += ",idfundo = " + ClipValue2Sql( aQry:idfundo )
聽 聽 聽 聽 聽cMsg += ",campana = " + ClipValue2Sql( aQry:campana )
聽 聽 聽 聽 聽cMsg += ",semana = " + ClipValue2Sql( aQry:semana )
聽 聽 聽 聽 聽cMsg += ",tipo = " + ClipValue2Sql( aQry:tipo )
聽 聽 聽 聽 聽cMsg += ",idpersonal = " + ClipValue2Sql( aQry:idpersonal )
聽 聽 聽 聽 聽cMsg += ",fecha = " + ClipValue2Sql( aQry:fecha )
聽 聽 聽 聽 聽cMsg += ",idparcela = " + ClipValue2Sql( aQry:idparcela )
聽 聽 聽 聽 聽cMsg += ",idlote = " + ClipValue2Sql( aQry:idlote )
聽 聽 聽 聽 聽cMsg += ",idlabor = " + ClipValue2Sql( aQry:idlabor ) + " "
聽 聽 聽 聽 聽cMsg += "WHERE id=" + ClipValue2Sql( aQry:id )

聽 聽 聽 聽 聽aServer:Execute( cMsg )

聽 聽 聽 ENDIF

聽 聽 聽 aQry:End() // ESTO ESTA CORRECTO?

聽 聽 聽 cQry:Skip()

聽 聽 聽 nnc++

聽 聽ENDDO

聽 聽HB_GCALL( .T. )

聽 聽cQry:End()

聽 聽lServer:End() // lSerVer := NIL ??

RETURN NIL
Regards, saludos.
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 230
Joined: Thu Sep 17, 2015 11:40 PM

Re: Error Irrecuperable 9009

Posted: Mon Jun 03, 2024 05:03 PM

ok voy hacer las pruebas tus punto de observaci贸n si lo que pasa q estoy reparando informacion en la nube con una base local, pruebo los cambios y aviso

Carlos Atuncar - CaSoftSystem
Chincha - Per煤
+51983478218
carlosalbatun@gmail.com
Posts: 230
Joined: Thu Sep 17, 2015 11:40 PM

Re: Error Irrecuperable 9009

Posted: Mon Jun 03, 2024 05:43 PM

Estoy corriendo lo planteado :

ya el consumo de memoria se a quedado en 61.4mb anterior mente se incrementaba seg煤n los registro leidos llego hasta 1899Mb ahora esta 61.5Mb pero lo que aumentado es el uso de CPU antes solo 0.6% ahora esta 12.3%

y el tiempo de se demora mas en avanzar con los registro SYSWAIT( 3.5 ) se le puede poner menos en este parametro ?

Carlos Atuncar - CaSoftSystem
Chincha - Per煤
+51983478218
carlosalbatun@gmail.com
Posts: 230
Joined: Thu Sep 17, 2015 11:40 PM

Re: Error Irrecuperable 9009

Posted: Mon Jun 03, 2024 05:47 PM

he modificado SYSWAIT( 0.5 ) esta m谩s rapido el proceso el consumo de memoria sigue estable en 61.5mb y el uso CPU entre 10.5%

Carlos Atuncar - CaSoftSystem
Chincha - Per煤
+51983478218
carlosalbatun@gmail.com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM

Re: Error Irrecuperable 9009

Posted: Mon Jun 03, 2024 06:43 PM
Carlos: Prueba y comente, pls. Nueva version:
Code (fw): Select all Collapse
FUNCTION ATUAL_REG()

聽 聽HB_GCALL( .F. )

聽 聽WaitOn( "Espere, recogiendo informacion...", @oWait )

聽 聽FWCONNECT lServer HOST cServer ;
聽 聽 聽 USER cUser 聽 聽 聽 聽 聽 聽 聽 聽 聽;
聽 聽 聽 PASSWORD cPassword 聽 聽 聽 聽 聽;
聽 聽 聽 DATABASE cDBName


聽 聽CheckConect()

聽 聽cMsg := "SELECT * FROM personal_mov p WHERE fecha='2030-03-04'"// LIMIT 2000"
聽 聽cQry := aServer:Query( cMsg )

聽 聽nnc := 1

聽 聽WHILE .NOT. cQry:Eof()

聽 聽 聽 SYSREFRESH()

聽 聽 聽 SYSWAIT( 0.5 ) // Delay aqui.

聽 聽 聽 HB_GCALL( .F. ) // Puede tambien: HB_GCALL()

聽 聽 聽 IF LASTKEY() = VK_ESCAPE

聽 聽 聽 聽 聽IF MsgNoYes( OemToAnsi( "Atenci贸n al usuario: " ) 聽 聽 聽+ CRLF + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 + CRLF + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 OemToAnsi( "Escribiste <ESCAPE> " ) 聽 聽 聽 + CRLF + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 OemToAnsi( "Tienes problemas " ) 聽 聽 聽 聽 聽+ CRLF + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 OemToAnsi( "驴en la actualizaci贸n? " ) 聽 聽 + CRLF + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 + CRLF + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 OemToAnsi( "驴Realmente quieres salir? " ) + CRLF + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 OemToAnsi( "Escribe todo..." ) 聽 聽 聽 聽 聽 聽+ CRLF + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 + CRLF + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 OemToAnsi( "<S> Estoy continuando... " ) 聽+ CRLF + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 OemToAnsi( "<N>o Continue(Salir) " ), 聽 聽 聽 聽 聽 聽 聽;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 OemToAnsi( "驴Problemas con el programa?" ) ) = .F.

聽 聽 聽 聽 聽 聽 // comando...

聽 聽 聽 聽 聽 聽 RETURN( .F. )

聽 聽 聽 聽 聽ENDIF

聽 聽 聽 ENDIF

聽 聽 聽 oWait:Say( 1, 3, "Espere, actualizando Reg.: " + AllTrim( Str( cQry:id ) ) + " -- " + AllTrim( Str( nnc ) ) + Space( 40 ) )

聽 聽 聽 cMsg := "SELECT * FROM personal_mov WHERE id = " + ClipValue2Sql( cQry:id )

聽 聽 聽 aQry := lServer:Query( cMsg )

聽 聽 聽 IF aQry:LastRec() > 0

聽 聽 聽 聽 聽oWait:Say( 1, 3, "Espere, actualizando Reg.: " + AllTrim( Str( cQry:id ) ) + " -- " + AllTrim( Str( nnc ) ) + " ok..." + Space( 30 ) )

聽 聽 聽 聽 聽// SysRefresh()

聽 聽 聽 聽 聽cMsg := "update personal_mov set "
聽 聽 聽 聽 聽cMsg += "idasistencia = " + ClipValue2Sql( aQry:idasistencia )
聽 聽 聽 聽 聽cMsg += ",idempresa = " + ClipValue2Sql( aQry:idempresa )
聽 聽 聽 聽 聽cMsg += ",idfundo = " + ClipValue2Sql( aQry:idfundo )
聽 聽 聽 聽 聽cMsg += ",campana = " + ClipValue2Sql( aQry:campana )
聽 聽 聽 聽 聽cMsg += ",semana = " + ClipValue2Sql( aQry:semana )
聽 聽 聽 聽 聽cMsg += ",tipo = " + ClipValue2Sql( aQry:tipo )
聽 聽 聽 聽 聽cMsg += ",idpersonal = " + ClipValue2Sql( aQry:idpersonal )
聽 聽 聽 聽 聽cMsg += ",fecha = " + ClipValue2Sql( aQry:fecha )
聽 聽 聽 聽 聽cMsg += ",idparcela = " + ClipValue2Sql( aQry:idparcela )
聽 聽 聽 聽 聽cMsg += ",idlote = " + ClipValue2Sql( aQry:idlote )
聽 聽 聽 聽 聽cMsg += ",idlabor = " + ClipValue2Sql( aQry:idlabor ) + " "
聽 聽 聽 聽 聽cMsg += "WHERE id=" + ClipValue2Sql( aQry:id )

聽 聽 聽 聽 聽aServer:Execute( cMsg )

聽 聽 聽 ENDIF

聽 聽 聽 aQry:End() // ESTO ESTA CORRECTO?

聽 聽 聽 cQry:Skip()

聽 聽 聽 nnc++

聽 聽ENDDO

聽 聽HB_GCALL( .T. )

聽 聽cQry:End()

聽 聽lServer:End() // lSerVer := NIL ??

RETURN NIL
Regards, saludos.
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 230
Joined: Thu Sep 17, 2015 11:40 PM

Re: Error Irrecuperable 9009 ( Solucionado )

Posted: Mon Jun 03, 2024 09:03 PM

Si Gracias lo solucione asi cada 1000 registros

WaitOn("Espere, recogiendo informacion...",@oWait )

HB_GCALL( .F. )

FWCONNECT lServer HOST cServer ;

              USER cUser ;

              PASSWORD cPassword ;

              DATABASE cDBName

CheckConect()

cMsg := "SELECT * FROM personal_mov p WHERE fecha='2030-03-04'"// LIMIT 2000"

cQry := aServer:Query( cMsg )

nnc := 1

xnn := 0

While !cQry:Eof()

oWait:Say(1,3,"Espere, actualizando Reg.: "+Alltrim( Str( cQry:id ) )+" -- "+Alltrim(Str(nnc))+Space(40) )

SysRefresh()

// si ha recorrido 1000 registro de limpie la memoria

If xnn>1000

  SYSWAIT( 0.5 )



  HB_GCALL( .F. )

  xnn:=0

Endif

cMsg := "SELECT * FROM personal_mov WHERE id = "+ClipValue2Sql( cQry:id )

aQry := lServer:Query( cMsg )

If aQry:lastrec()>0

  oWait:Say(1,3,"Espere, actualizando Reg.: "+Alltrim( Str( cQry:id ) )+" -- "+Alltrim(Str(nnc))+" ok..."+Space(30) )

  SysRefresh()



  cMsg := "update personal_mov set "

  cMsg += "idasistencia = "+ClipValue2Sql( aQry:idasistencia )

  cMsg += ",idempresa = "+ClipValue2Sql( aQry:idempresa )

  cMsg += ",idfundo = "+ClipValue2Sql( aQry:idfundo )

  cMsg += ",campana = "+ClipValue2Sql( aQry:campana )

  cMsg += ",semana = "+ClipValue2Sql( aQry:semana )

  cMsg += ",tipo = "+ClipValue2Sql( aQry:tipo )

  cMsg += ",idpersonal = "+ClipValue2Sql( aQry:idpersonal )

  cMsg += ",fecha = "+ClipValue2Sql( aQry:fecha )

  cMsg += ",idparcela = "+ClipValue2Sql( aQry:idparcela )

  cMsg += ",idlote = "+ClipValue2Sql( aQry:idlote )

  cMsg += ",idlabor = "+ClipValue2Sql( aQry:idlabor )+" "

  cMsg += "WHERE id="+ClipValue2Sql( aQry:id )

  aServer:Execute( cMsg )

EndIf

aQry:End()

cQry:Skip()

nnc++

xnn++

EndDo

cQry:End()

lServer:End()

WaitOff( @oWait )

Return

Carlos Atuncar - CaSoftSystem
Chincha - Per煤
+51983478218
carlosalbatun@gmail.com
Posts: 851
Joined: Sun Nov 09, 2014 05:01 PM

Re: Error Irrecuperable 9009

Posted: Mon Jun 03, 2024 09:47 PM

Hace un par de meses tuve un problema similar.

El detalle (en mi caso) fue que windows 32 bits solo reconoce hasta 4gb de RAM. Puedes tener mas, pero creo que no pasa de 3.5gb para uso de nuestras aplicaciones. Incluso, puedes tener windows de 64 bits, que reconoce hasta 2TB pero si tu aplicacion esta compilada a 32 bits, el resultado sera el mismo: 3.5gb disponibles.

La conclusi贸n a la que llegue fue: o migrar mi app a FW64BITS o seccionar el reporte.

Resolv铆 con lo 煤ltimo, ya que no tengo fw64

Ser铆a bueno escuchar la opini贸n de otros usuarios.

"Los errores en programaci贸n, siempre est谩n entre la silla y el teclado..."



Fwh 19.06 32 bits + Harbour 3.2 + Borland 7.4 + MariaDB + TDolphin



Carora, Estado Lara, Venezuela.
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Error Irrecuperable 9009 ( Solucion en 32bits )

Posted: Tue Jun 04, 2024 05:56 AM

FWH64 es capaz de usar much铆sima mas memoria que FWH32

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 318
Joined: Fri Jan 14, 2022 08:37 AM

Re: Error Irrecuperable 9009 ( Solucion en 32bits )

Posted: Tue Jun 04, 2024 10:49 AM
Son las cosas de la concatenacion de cadenas, que fragmenta la memoria y es capaz de echar abajo al ordenador con mas memoria del mundo :D

Aqu铆 se habla del asunto y Manu Exp贸sito aporta una soluci贸n que no s贸lo evita la fragmentaci贸n sino que mejora la velocidad en los procesos de concatenaci贸n. Para leerlo con gusto: https://forums.fivetechsupport.com/viewtopic.php?f=6&t=35548&hilit=mora&sid=c88d9c6f2d02d58b6d168dd79cbffdb2#p211646
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM

Re: Error Irrecuperable 9009 ( Solucion en 32bits )

Posted: Tue Jun 04, 2024 09:31 PM

Una cosa es que llamar un sysrefresh en un ciclo es peligroso, se debe hacer cada x ciclos, hacerlo en cada iteraci贸n no es lo adecuado, por ejemplo yo hago que cada 20 iteraciones llame al sysrefresh, por ejemplo antes de incio del ciclo inicializado una var contadora a cero, la incrementas en cada iteraci贸n y haces un control para que se ejecute sysrefresh cada cierto tiempo.

Var:=0

Do while ...

++Var

...

If mod(Var,20)=0

 Sysrefresh()

Endif

Enddo

Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM

Re: Error Irrecuperable 9009 ( Solucion en 32bits )

Posted: Tue Jun 04, 2024 09:32 PM
Una cosa es que llamar un sysrefresh en un ciclo es peligroso, se debe hacer cada x ciclos, hacerlo en cada iteraci贸n no es lo adecuado, por ejemplo yo hago que cada 20 iteraciones llame al sysrefresh, por ejemplo antes de incio del ciclo inicializado una var contadora a cero, la incrementas en cada iteraci贸n y haces un control para que se ejecute sysrefresh cada cierto tiempo.
Code (fw): Select all Collapse
Var:=0
Do while ...
聽 ++Var
聽 ...
聽 If mod(Var,20)=0
聽 聽 聽Sysrefresh()
聽 Endif
Enddo
Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)