porting an app that checks /proc/meminfo

Ulrich Spoerlein q at galgenberg.net
Fri Jan 27 02:53:16 PST 2006


Fernan Aguero wrote:
> How does one gets the values of
> i) memory used by the program/process and

As others have already told you: getrusage(2)

> ii) amount of RAM available in the computer without using
> /proc/meminfo in FreeBSD?

What for? It is a rather useless value anyway. Either your malloc(3)
calls succeed or not. If they do depends not only on RAM, but on the VM,
Swap, and limits(1) (please correct me, if I'm wrong).

So the question is, what's the value used for in his program?

Ulrich Spoerlein
-- 
 PGP Key ID: 20FEE9DD				Encrypted mail welcome!
Fingerprint: AEC9 AF5E 01AC 4EE1 8F70  6CBD E76E 2227 20FE E9DD
Which is worse: ignorance or apathy?
Don't know. Don't care.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20060127/469038e9/attachment.bin


More information about the freebsd-ports mailing list