[Mathew Thomas]
> Does anyone know of a system call or technique of finding out how much
> RAM is available for malloc without going into virtual memory?  That is
> - how much physical memory can I get befor I start paging or swapping??
> I'm hoping that there is a system call that can give me this info.  Any
> help would be appreciated.

paging/swapping isn't necessarily going to occur simply because there
could be clean, unref'd pages that'll get tossed well before you'd bother
paging.  It's not clear-cut from a given instant in time how much you'd
have to allocate to really force paging.

That said, there is a getconf param for available phys pages

% echo $[ $(getconf _AVPHYS_PAGES) * $(getconf PAGE_SIZE) / 1024 ] KB free
4804 KB free

might get stuck parsing /proc/meminfo otherwise.

James
-- 
James Manning <[EMAIL PROTECTED]>
GPG Key fingerprint = B913 2FBD 14A9 CE18 B2B7  9C8E A0BF B026 EEBB F6E4



_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

Reply via email to