Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Two percent of zero is almost nothing.


devel / comp.lang.xharbour / Re: total and free or used ram memory

SubjectAuthor
* total and free or used ram memoryCV
`* Re: total and free or used ram memoryCV
 `* Re: total and free or used ram memoryCV
  `- Re: total and free or used ram memoryreina...@gmail.com

1
total and free or used ram memory

<aad5b5ea-f4c9-47f3-bda2-4e4670d62059n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17447&group=comp.lang.xharbour#17447

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:622a:1c5:b0:3f6:af78:de08 with SMTP id t5-20020a05622a01c500b003f6af78de08mr9329626qtw.12.1687980860417;
Wed, 28 Jun 2023 12:34:20 -0700 (PDT)
X-Received: by 2002:a05:6808:2027:b0:3a2:6d07:ad48 with SMTP id
q39-20020a056808202700b003a26d07ad48mr2107379oiw.4.1687980860172; Wed, 28 Jun
2023 12:34:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Wed, 28 Jun 2023 12:34:19 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=181.165.243.127; posting-account=PzJOtwoAAAB-nLPGTsEPjzvj-I7nsyBK
NNTP-Posting-Host: 181.165.243.127
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <aad5b5ea-f4c9-47f3-bda2-4e4670d62059n@googlegroups.com>
Subject: total and free or used ram memory
From: cvoskian@gmail.com (CV)
Injection-Date: Wed, 28 Jun 2023 19:34:20 +0000
Content-Type: text/plain; charset="UTF-8"
 by: CV - Wed, 28 Jun 2023 19:34 UTC

Hi all

In an application I wrote sometime ago, I need to add this for documenting purposes:

- the total amount of ram memory installed (for example 8 gb or 8192 mb or whatever)
AND
(the total _free_ ram memory available OR the total _used_ ram memory)

I don't need the amount of memory used by the application - I can play with the memory(...) function for that.
Something like the windows task manager shows when invoked - no matter the windows version (and by now, no need to know all the details task manager shows, i.e. the applications-running list).

Is there a way to get this under xharbour?
Preferably by code, not invoking a command line utility.

Best regards
--
Claudio Voskian
Buenos Aires - Argentina

Re: total and free or used ram memory

<63b7e0ed-998b-4efe-8990-cb32c0ceb96en@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17448&group=comp.lang.xharbour#17448

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:6214:9a4:b0:635:f554:acca with SMTP id du4-20020a05621409a400b00635f554accamr11693qvb.6.1687983043531;
Wed, 28 Jun 2023 13:10:43 -0700 (PDT)
X-Received: by 2002:a05:6870:970e:b0:1b0:2f63:4ff5 with SMTP id
n14-20020a056870970e00b001b02f634ff5mr5351266oaq.1.1687983043368; Wed, 28 Jun
2023 13:10:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Wed, 28 Jun 2023 13:10:43 -0700 (PDT)
In-Reply-To: <aad5b5ea-f4c9-47f3-bda2-4e4670d62059n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=181.165.243.127; posting-account=PzJOtwoAAAB-nLPGTsEPjzvj-I7nsyBK
NNTP-Posting-Host: 181.165.243.127
References: <aad5b5ea-f4c9-47f3-bda2-4e4670d62059n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <63b7e0ed-998b-4efe-8990-cb32c0ceb96en@googlegroups.com>
Subject: Re: total and free or used ram memory
From: cvoskian@gmail.com (CV)
Injection-Date: Wed, 28 Jun 2023 20:10:43 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2337
 by: CV - Wed, 28 Jun 2023 20:10 UTC

El miércoles, 28 de junio de 2023 a la(s) 16:34:21 UTC-3, CV escribió:
> Hi all
>
> In an application I wrote sometime ago, I need to add this for documenting purposes:
>
> - the total amount of ram memory installed (for example 8 gb or 8192 mb or whatever)
> AND
> (the total _free_ ram memory available OR the total _used_ ram memory)
>
> I don't need the amount of memory used by the application - I can play with the memory(...) function for that.
> Something like the windows task manager shows when invoked - no matter the windows version (and by now, no need to know all the details task manager shows, i.e. the applications-running list).
>
> Is there a way to get this under xharbour?
> Preferably by code, not invoking a command line utility.
>
> Best regards
> --
> Claudio Voskian
> Buenos Aires - Argentina

Hi

I just noticed that I will not find the total memory because I'm using a 32 bit application, and will not see the real total (more than 4 gb in this case, 32 gb in the client machine).

Please, disregard my request.

Regards
©

Re: total and free or used ram memory

<6da62f3b-bb67-4df0-aa34-a9fdb2343ad0n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17495&group=comp.lang.xharbour#17495

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a37:5a06:0:b0:767:f116:1901 with SMTP id o6-20020a375a06000000b00767f1161901mr8317qkb.11.1691177228991;
Fri, 04 Aug 2023 12:27:08 -0700 (PDT)
X-Received: by 2002:a05:6808:10cc:b0:3a7:763f:2501 with SMTP id
s12-20020a05680810cc00b003a7763f2501mr3832960ois.5.1691177228251; Fri, 04 Aug
2023 12:27:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Fri, 4 Aug 2023 12:27:08 -0700 (PDT)
In-Reply-To: <63b7e0ed-998b-4efe-8990-cb32c0ceb96en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=181.165.243.127; posting-account=PzJOtwoAAAB-nLPGTsEPjzvj-I7nsyBK
NNTP-Posting-Host: 181.165.243.127
References: <aad5b5ea-f4c9-47f3-bda2-4e4670d62059n@googlegroups.com> <63b7e0ed-998b-4efe-8990-cb32c0ceb96en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6da62f3b-bb67-4df0-aa34-a9fdb2343ad0n@googlegroups.com>
Subject: Re: total and free or used ram memory
From: cvoskian@gmail.com (CV)
Injection-Date: Fri, 04 Aug 2023 19:27:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3471
 by: CV - Fri, 4 Aug 2023 19:27 UTC

El miércoles, 28 de junio de 2023 a la(s) 17:10:44 UTC-3, CV escribió:
> El miércoles, 28 de junio de 2023 a la(s) 16:34:21 UTC-3, CV escribió:
> > Hi all
> >
> > In an application I wrote sometime ago, I need to add this for documenting purposes:
> >
> > - the total amount of ram memory installed (for example 8 gb or 8192 mb or whatever)
> > AND
> > (the total _free_ ram memory available OR the total _used_ ram memory)
> >
> > I don't need the amount of memory used by the application - I can play with the memory(...) function for that.
> > Something like the windows task manager shows when invoked - no matter the windows version (and by now, no need to know all the details task manager shows, i.e. the applications-running list).
> >
> > Is there a way to get this under xharbour?
> > Preferably by code, not invoking a command line utility.
> >
> > Best regards
> > --
> > Claudio Voskian
> > Buenos Aires - Argentina
> Hi
>
> I just noticed that I will not find the total memory because I'm using a 32 bit application, and will not see the real total (more than 4 gb in this case, 32 gb in the client machine).
>
> Please, disregard my request.
>
> Regards
> ©
Hi

for those of you willing to know this information (about total, used and free memory installed), I write this set of functions (works fine under xharbour 32 bits):

// bof
function main()

? "total", TOTALMEMORY(), "used", USEDMEMORY(), "free", FREEMEMORY() // all in bytes

return nil

#pragma BEGINDUMP
#include <windows.h>

HB_FUNC( TOTALMEMORY ) {
MEMORYSTATUSEX st;
st.dwLength = sizeof(st);
GlobalMemoryStatusEx(&st);

hb_retnll( ( LONGLONG ) st.ullTotalPhys);
}

HB_FUNC( USEDMEMORY ) {
MEMORYSTATUSEX st;
st.dwLength = sizeof(st);
GlobalMemoryStatusEx(&st);

hb_retnll( ( LONGLONG ) st.ullTotalPhys - st.ullAvailPhys);
}

HB_FUNC( FREEMEMORY ) {
MEMORYSTATUSEX st;
st.dwLength = sizeof(st);
GlobalMemoryStatusEx(&st);

hb_retnll( ( LONGLONG ) st.ullAvailPhys);
} #pragma ENDDUMP
// eof

Regards
--
Claudio Voskian
Buenos Aires - Argentina

Re: total and free or used ram memory

<bd53e5fd-04c4-452d-a969-9a3a5e3227b0n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17496&group=comp.lang.xharbour#17496

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ad4:588c:0:b0:63c:eda9:400a with SMTP id dz12-20020ad4588c000000b0063ceda9400amr9486qvb.1.1691193395639;
Fri, 04 Aug 2023 16:56:35 -0700 (PDT)
X-Received: by 2002:a05:6808:210f:b0:3a7:2041:f034 with SMTP id
r15-20020a056808210f00b003a72041f034mr4624400oiw.9.1691193395251; Fri, 04 Aug
2023 16:56:35 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Fri, 4 Aug 2023 16:56:35 -0700 (PDT)
In-Reply-To: <6da62f3b-bb67-4df0-aa34-a9fdb2343ad0n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2804:17bc:155:e100:39c4:7c76:52f9:52bc;
posting-account=yZJwlQoAAADzKZZdom395T93hGRZPX0-
NNTP-Posting-Host: 2804:17bc:155:e100:39c4:7c76:52f9:52bc
References: <aad5b5ea-f4c9-47f3-bda2-4e4670d62059n@googlegroups.com>
<63b7e0ed-998b-4efe-8990-cb32c0ceb96en@googlegroups.com> <6da62f3b-bb67-4df0-aa34-a9fdb2343ad0n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bd53e5fd-04c4-452d-a969-9a3a5e3227b0n@googlegroups.com>
Subject: Re: total and free or used ram memory
From: reinaldohf@gmail.com (reina...@gmail.com)
Injection-Date: Fri, 04 Aug 2023 23:56:35 +0000
Content-Type: text/plain; charset="UTF-8"
 by: reina...@gmail.com - Fri, 4 Aug 2023 23:56 UTC

Hi Claudio,

>
> // bof
> function main()
>
> ? "total", TOTALMEMORY(), "used", USEDMEMORY(), "free", FREEMEMORY() // all in bytes
>
> return nil
>
> #pragma BEGINDUMP
> #include <windows.h>
>
> HB_FUNC( TOTALMEMORY ) {
> MEMORYSTATUSEX st;
> st.dwLength = sizeof(st);
> GlobalMemoryStatusEx(&st);
>
> hb_retnll( ( LONGLONG ) st.ullTotalPhys);
> }
>
> HB_FUNC( USEDMEMORY ) {
> MEMORYSTATUSEX st;
> st.dwLength = sizeof(st);
> GlobalMemoryStatusEx(&st);
>
> hb_retnll( ( LONGLONG ) st.ullTotalPhys - st.ullAvailPhys);
> }
>
> HB_FUNC( FREEMEMORY ) {
> MEMORYSTATUSEX st;
> st.dwLength = sizeof(st);
> GlobalMemoryStatusEx(&st);
>
> hb_retnll( ( LONGLONG ) st.ullAvailPhys);
> }
> #pragma ENDDUMP
> // eof
For me it works fine!
Thanks for the code!

Reynaldo Henrique

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor