[mythtv] hdtvrecorder: dynamic ringbuffers?
Florin Andrei
florin at andrei.myip.org
Wed Dec 22 18:58:55 UTC 2004
On Wed, 2004-12-22 at 16:41 +0000, Tom Hughes wrote:
> In message <41C99A1F.6000505 at BlueSkyTours.com>
> John Patrick Poet <john at BlueSkyTours.com> wrote:
>
> > Do you know how to detect the amount of physical RAM in the system?
>
> On linux you do this:
>
> sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE)
I guess you could always read /proc
However, i'm not sure how consistent it is between platforms, plus you
may have to do some ugly string parsing:
[florin at stantz ~]$ cat /proc/meminfo
MemTotal: 514640 kB
MemFree: 38656 kB
Buffers: 36640 kB
Cached: 223620 kB
SwapCached: 0 kB
Active: 324192 kB
Inactive: 115736 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 514640 kB
LowFree: 38656 kB
SwapTotal: 1228964 kB
SwapFree: 1228964 kB
Dirty: 184 kB
Writeback: 0 kB
Mapped: 240380 kB
Slab: 22880 kB
Committed_AS: 715372 kB
PageTables: 6708 kB
VmallocTotal: 3612664 kB
VmallocUsed: 6544 kB
VmallocChunk: 3605880 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 2048 kB
--
Florin Andrei
http://florin.myip.org/
More information about the mythtv-dev
mailing list