Memory() under Fivewin

Memory() under Fivewin

Postby Jimmy » Mon Mar 27, 2023 3:10 am

hi,

how to get "Total Memory" and "Available Memory" under Fivewin :?:

have try Memory(1) up to Memory(4) but Value seem not to "match"
have found MemStat() but it show Array in Msgbox() ... how get 3rd Element of Array :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Memory() under Fivewin

Postby Antonio Linares » Mon Mar 27, 2023 6:40 am

Dear Jimmy,

function Memory() belongs to Harbour which does a wrapper to Harbour's hb_xquery() function:
https://github.com/harbour/core/blob/master/src/vm/fm.c

Basically is uses the Windows API functions to query those values
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42117
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Memory() under Fivewin

Postby Jimmy » Mon Mar 27, 2023 9:24 am

hi Antonio,

i have now try MEMORY() with all "hbmemory.ch" Constant
but still "Total Memory" (2,914 GB get by WMI) of 32 Bit OS is not shown
Image

Code: Select all  Expand view  RUN
/* Parameters for Memory() function */

/* Standard */
#define HB_MEM_CHAR             0   /* Free Variable Space (KB) */
#define HB_MEM_BLOCK            1   /* Largest String (KB) */
#define HB_MEM_RUN              2   /* RUN Memory (KB) */

/* CA-Cl*pper undocumented */
#define HB_MEM_VM               3   /* Virtual Memory (KB) */
#define HB_MEM_EMS              4   /* Free Expanded Memory (KB) (?) */
#define HB_MEM_FM             101   /* Fixed Memory/Heap (KB) (?) */
#define HB_MEM_FMSEGS         102   /* Segments in Fixed Memory/Heap (?) */
#define HB_MEM_SWAP           103   /* Free Swap Memory (KB) */
#define HB_MEM_CONV           104   /* Free Conventional (KB) */
#define HB_MEM_EMSUSED        105   /* Used Expanded Memory (KB) (?) */

/* Harbour extensions */
#define HB_MEM_USED          1001   /* Memory used (bytes) */
#define HB_MEM_USEDMAX       1002   /* Maximum memory used (bytes) */
#define HB_MEM_STACKITEMS    1003   /* Total items on the stack */
#define HB_MEM_STACK         1004   /* Total memory size used by the stack (bytes) */
#define HB_MEM_STACK_TOP     1005   /* Total items currently on the stack */
#define HB_MEM_BLOCKS        1007   /* Total number of memory blocks allocated */
#define HB_MEM_STATISTICS    1008   /* Return non 0 value if FM statistic is enabled */
#define HB_MEM_CANLIMIT      1009   /* Return non 0 value if used memory limit is supported */
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Memory() under Fivewin

Postby Jimmy » Mon Mar 27, 2023 11:02 am

hi,

found solution in c:\fwh\source\function\errsysw_.prg

Code: Select all  Expand view  RUN
cErrorLog += "   Hardware memory: " + ;
                    cValToChar( Int( nExtMem() / ( 1024 * 1024 ) ) + 1 ) + " MB ( available: "+;
                    cValToChar (Int (nAvailMem() / (1024 * 1024 ) ) +1 ) + " MB )" + CRLF + CRLF
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Memory() under Fivewin

Postby Antonio Linares » Mon Mar 27, 2023 11:07 am

very good :-)

Ye, FWH uses its own memory functions
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42117
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 57 guests