Free memory and free disk

Hi, can anyone tell me which function I have to use in order to find out the
available memory and disk space information in my C program? I used to call
qnx_osinfo in QNX 4.2, but unfortunately this function is no longer
available in Neutrino. Thanks.

Johannes <Jsukamtoh@infolink.co.id> wrote:

available memory

stat("/proc", &st) and look at st.st_size

and disk space information in my C program?

statvfs("/", &vfs) and look at vfs.f_bavail*vfs.f_frsize

(replace “/” by the mountpoint of the disk/filesystem you want to query).

Thanks. And one more question. How to get the total memory installed? stat
returns the available memory free to use only.

“John Garvey” <jgarvey@qnx.com> wrote in message
news:bbegtf$j62$1@nntp.qnx.com

Johannes <> Jsukamtoh@infolink.co.id> > wrote:
available memory

stat("/proc", &st) and look at st.st_size

and disk space information in my C program?

statvfs("/", &vfs) and look at vfs.f_bavail*vfs.f_frsize

(replace “/” by the mountpoint of the disk/filesystem you want to query).

SYSPAGE_ENTRY(system_private)->ramsize;

Johannes wrote:

Thanks. And one more question. How to get the total memory installed? stat
returns the available memory free to use only.

“John Garvey” <> jgarvey@qnx.com> > wrote in message
news:bbegtf$j62$> 1@nntp.qnx.com> …
Johannes <> Jsukamtoh@infolink.co.id> > wrote:
available memory

stat("/proc", &st) and look at st.st_size

and disk space information in my C program?

statvfs("/", &vfs) and look at vfs.f_bavail*vfs.f_frsize

(replace “/” by the mountpoint of the disk/filesystem you want to query).

That’s the original amount of memory, not the current free amount and
as documented in the release notes, the “ramsize” field won’t be set
after 6.2.1, since it’s 4G limited. The release notes give the proper
code to determine the total amount of RAM on the system.

stat("/proc"…) is the proper way to get current free memory.


John A. Murphy <murf@perftech.com> wrote:

SYSPAGE_ENTRY(system_private)->ramsize;

Johannes wrote:

Thanks. And one more question. How to get the total memory installed? stat
returns the available memory free to use only.

“John Garvey” <> jgarvey@qnx.com> > wrote in message
news:bbegtf$j62$> 1@nntp.qnx.com> …
Johannes <> Jsukamtoh@infolink.co.id> > wrote:
available memory

stat("/proc", &st) and look at st.st_size

and disk space information in my C program?

statvfs("/", &vfs) and look at vfs.f_bavail*vfs.f_frsize

(replace “/” by the mountpoint of the disk/filesystem you want to query).


Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

The question concerned “total memory installed”; but thanks for the heads-up on
post 6.2.1 releases!

bstecher@qnx.com wrote:

That’s the original amount of memory, not the current free amount and
as documented in the release notes, the “ramsize” field won’t be set
after 6.2.1, since it’s 4G limited. The release notes give the proper
code to determine the total amount of RAM on the system.

stat("/proc"…) is the proper way to get current free memory.

John A. Murphy <> murf@perftech.com> > wrote:
SYSPAGE_ENTRY(system_private)->ramsize;

Johannes wrote:

Thanks. And one more question. How to get the total memory installed? stat
returns the available memory free to use only.

“John Garvey” <> jgarvey@qnx.com> > wrote in message
news:bbegtf$j62$> 1@nntp.qnx.com> …
Johannes <> Jsukamtoh@infolink.co.id> > wrote:
available memory

stat("/proc", &st) and look at st.st_size

and disk space information in my C program?

statvfs("/", &vfs) and look at vfs.f_bavail*vfs.f_frsize

(replace “/” by the mountpoint of the disk/filesystem you want to query).


Brian Stecher (> bstecher@qnx.com> ) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8