Dúvida memória livre 32 bits/64 bits
Moderador: Moderadores
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Dúvida memória livre 32 bits/64 bits
Tudo bem, não vou chegar a tanto uso de memória, mas...
Está mostrando 4GB de memória livre.
Se 32 bits só mapeia 4GB, e se o programa está carregado, deveria ser menos... ou não?
Está mostrando 4GB de memória livre.
Se 32 bits só mapeia 4GB, e se o programa está carregado, deveria ser menos... ou não?
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Dúvida memória livre 32 bits/64 bits
Não tem isso no Harbour.
Mas encontrei o exemplo memory.prg na pasta harbour\tests.
Fiz um teste com todas as opções.
Talvez seja importante conforme o sistema operacional.
Mas encontrei o exemplo memory.prg na pasta harbour\tests.
Fiz um teste com todas as opções.
Talvez seja importante conforme o sistema operacional.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
-
Kapiaba
- Colaborador

- Mensagens: 1908
- Registrado em: 07 Dez 2012 16:14
- Localização: São Paulo
- Contato:
Dúvida memória livre 32 bits/64 bits
Pode testar por favor, para vermos se funciona em Harbour? Não uso Harbour, portanto não tenho como testar ainda.
Obg. abs.
Código: Selecionar todos
#include "hbmemory.ch"
#include "hbclass.ch"
#define MAXTEST 10000
PROCEDURE MAIN()
LOCAL n, ao := {}, nMem, nTime
REQUEST HB_GT_WIN
nTime := Seconds()
nMem := Memory( HB_MEM_USED )
FOR n := 1 TO MAXTEST
aAdd( ao, PROBLEM() )
// Here harbour have a loose of performance. ????
ao[n] := Nil
hb_gcAll( .T. )
? 'Mem used -> ' + AllTrim( Str( Memory( HB_MEM_USED ) ) )
NEXT
ao := {}
hb_gcAll( .T. )
? "We lost " + AllTrim( Str( Memory( HB_MEM_USED ) - nMem ) ) + " Bytes"
? "Elapsed time " + AllTrim( Str( Seconds() - nTime ) )
RETURN
FUNCTION PROBLEM()
LOCAL cValue := {' '}
LOCAL oMem1 := Mem():New()
RETURN Ctl():New( oMem1, bSetGet( cValue, 1 ), 'XXXX' )
CLASS Mem
DATA aValues INIT {}
DATA oFriend
METHOD New( oFriend ) CONSTRUCTOR
METHOD AddItem( oItem ) INLINE AAdd( ::aValues, oItem )
ENDCLASS
METHOD New( oFriend ) CLASS Mem
IF ! Empty( oFriend )
::oFriend := oFriend
oFriend:AddItem( Self )
ENDIF
RETURN Self
CLASS Ctl
DATA oFriend
DATA oGet
METHOD New( oFriend, bSetGet, cPict ) CONSTRUCTOR
ENDCLASS
METHOD New( oFriend, bSetGet, cPict ) CLASS Ctl
oFriend:AddItem( Self )
::oFriend := oFriend
::oGet := GetNew( 20, 20, bSetGet,, cPict )
RETURN Self
FUNCTION bSetGet( uVar, nVal )
RETURN {|u| If( PCount() > 1, uVar[nVal] := u, uVar[nVal] ) }
-
Kapiaba
- Colaborador

- Mensagens: 1908
- Registrado em: 07 Dez 2012 16:14
- Localização: São Paulo
- Contato:
Dúvida memória livre 32 bits/64 bits
Em xHarbour, creio que deva ser assim:
abs.
Código: Selecionar todos
#include "hbmemory.ch"
#include "hbclass.ch"
#ifndef __XHARBOUR__
#xtranslate Str( <x>, <y>, <z>, .F. ) => Str( <x>, <y>, <z> )
#xtranslate Str( <x>, <y>, <z>, .T. ) => LTrim( Str( <x>, <y>, <z> ) )
#xtranslate Str( <x>, <y>, <z>, <k> ) => If( <k>, LTrim( Str( <x>, <y>, <z> ) ), Str( <x>, <y>, <z> ) )
#include "xhb.ch"
#endif
#ifdef DEFAULT
#UNDEF DEFAULT
#endif
#xcommand DEFAULT <v1> := <x1> [, <vn> := <xn> ] => ;
If( <v1> == nil, <v1> := <x1>, ) ;
[; If( <vn> == nil, <vn> := <xn>, ) ]
#define MAXTEST 1500
PROCEDURE MAIN()
LOCAL n, ao := {}, nMem
REQUEST HB_GT_WIN
FOR n := 1 TO MAXTEST
// here loose Harbour
aAdd( ao, PROBLEM() )
// ------------------
ao[-1] := 0
hb_gcAll( .T. )
// Here loose xHarbour
DEFAULT nMem := Memory( HB_MEM_USED )
//--------------------
#ifdef __XHARBOUR__
? 'Mem used -> ' + AllTrim( Str( Memory( HB_MEM_USED ) ) ) + " on " + AllTrim( Transform( Memory( HB_MEM_BLOCKS ), '@E
999,999,999' ) ) + " bloqs"
#else
? 'Mem used -> ' + AllTrim( Str( Memory( HB_MEM_USED ) ) )
#endif
IF n == MAXTEST
? "We lost " + AllTrim( Str( Memory( HB_MEM_USED ) - nMem ) ) + " Bytes"
ENDIF
NEXT
RETURN
FUNCTION PROBLEM()
LOCAL cValue := {' '}
LOCAL oMem1 := Mem():New()
RETURN Ctl():New( oMem1, bSetGet( cValue, 1 ), 'XXXX' )
CLASS Mem
DATA aValues INIT {}
DATA oFriend
METHOD New( oFriend ) CONSTRUCTOR
METHOD AddItem( oItem ) INLINE AAdd( ::aValues, oItem )
ENDCLASS
METHOD New( oFriend ) CLASS Mem
//::aValues := { 1, "TEST", Date(), {}, {=>} }
IF ! Empty( oFriend )
::oFriend := oFriend
oFriend:AddItem( Self )
ENDIF
RETURN Self
CLASS Ctl
DATA oFriend
DATA oGet
METHOD New( oFriend, bSetGet, cPict ) CONSTRUCTOR
ENDCLASS
METHOD New( oFriend, bSetGet, cPict ) CLASS Ctl
oFriend:AddItem( Self )
::oFriend := oFriend
::oGet := GetNew( 20, 20, bSetGet,, cPict )
RETURN Self
FUNCTION bSetGet( uVar, nVal )
RETURN {|u| If( PCount() > 1, uVar[nVal] := u, uVar[nVal] ) }
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Dúvida memória livre 32 bits/64 bits
Resultado Harbour 3.4 e msvc
É o que mostro naquela janela em "mem_used"
Só que no meu aplicativo rodando também retorna 0, então não sei como considerar.Mem used -> 0
Mem used -> 0
Mem used -> 0
Mem used -> 0
Mem used -> 0
Mem used -> 0
Mem used -> 0
Mem used -> 0
Mem used -> 0
Mem used -> 0
Mem used -> 0
Mem used -> 0
Mem used -> 0
We lost 0 Bytes
Elapsed time 41.14
É o que mostro naquela janela em "mem_used"
Código: Selecionar todos
? Memory( HB_MEM_USED )
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Dúvida memória livre 32 bits/64 bits
Não sei se em multithread acaba expandindo ao uso de 4GB por thread.
Se for assim, sem querer aumentei a capacidade do meu aplicativo.
Se é que algum dia vou chegar nesse limite...
Se for assim, sem querer aumentei a capacidade do meu aplicativo.
Se é que algum dia vou chegar nesse limite...
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/