[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: make -j in Debian packages



On Fri, Jun 30, 2006 at 12:12:10PM +0200, Adam Borowski wrote:
> Oh, so you mean checking the _free_ RAM instead of the _physical_ RAM?
> This would be reasonable -- I didn't use this in the debian/rules
> snippet I proposed as the physical memory is a trivially discernable
> number while free RAM can be sometimes hard to tell, especially on Xen:
[...]
> Of course, when I say that something is tricky, it doesn't mean that
> someone with more clue than me can't do it.
[...]

Just grep it out of /proc/meminfo? Something like this ugly bit of
bourne shell:

   echo $(
      grep ^MemTotal: /proc/meminfo | awk '{ print $2 }'
   ) - $(
      grep ^MemFree: /proc/meminfo | awk '{ print $2 }'
   ) - $(
      grep ^Buffers: /proc/meminfo | awk '{ print $2 }'
   ) - $(
      grep ^Cached: /proc/meminfo | awk '{ print $2 }'
   ) | bc

Which would give you a count of the total kb minus what's free and
in use for buffers/cache, similar to what free(1) spits out, but
probably not identical. That might not be an option on older kernels
(I seem to remember dealing with some /proc/meminfo change a while
back that broke check_swap in nagios-plugins), or at least might
differ at particular points in the kernel's release history.
-- 
{ IRL(Jeremy_Stanley); PGP(9E8DFF2E4F5995F8FEADDC5829ABF7441FB84657);
SMTP(fungi@yuggoth.org); IRC(fungi@irc.yuggoth.org#ccl); ICQ(114362511);
AIM(dreadazathoth); YAHOO(crawlingchaoslabs); FINGER(fungi@yuggoth.org);
MUD(fungi@katarsis.mudpy.org:6669); WWW(http://fungi.yuggoth.org/); }



Reply to: