From owner-freebsd-questions@FreeBSD.ORG Wed Jul 29 08:50:24 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43A1A10656C8 for ; Wed, 29 Jul 2009 08:50:24 +0000 (UTC) (envelope-from mirror176@cox.net) Received: from fed1rmmtao102.cox.net (fed1rmmtao102.cox.net [68.230.241.44]) by mx1.freebsd.org (Postfix) with ESMTP id 068458FC1F for ; Wed, 29 Jul 2009 08:50:23 +0000 (UTC) (envelope-from mirror176@cox.net) Received: from fed1rmimpo02.cox.net ([70.169.32.72]) by fed1rmmtao102.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20090729085023.TFUA20976.fed1rmmtao102.cox.net@fed1rmimpo02.cox.net> for ; Wed, 29 Jul 2009 04:50:23 -0400 Received: from darkstar.l.net ([98.165.138.223]) by fed1rmimpo02.cox.net with bizsmtp id MkqP1c0074pNzHu04kqPHe; Wed, 29 Jul 2009 04:50:23 -0400 X-VR-Score: 0.00 X-Authority-Analysis: v=1.0 c=1 a=DZOHcWS8HRrlxXPjSIAA:9 a=WuDbNY42IBwWbG6A38Gg6L2HwRcA:4 X-CM-Score: 0.00 Received: from localhost (localhost [127.0.0.1]) (uid 1001) by darkstar.l.net with local; Wed, 29 Jul 2009 01:50:22 -0700 id 00017A53.4A700D4E.0000F941 From: "Edward Sanford Sutton, III" To: freebsd-questions@freebsd.org Date: Wed, 29 Jul 2009 01:50:22 -0700 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907290150.22783.mirror176@cox.net> Subject: How to get SystemMemorySize? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 08:50:24 -0000 Something like the following should use the power of sysctl. physmem and usermem in place of realmem may be of use too. Just wish I knew proper values nad logic to tweak kern.ipc.shmmax and similar paramaters. int realmem; char* realmem_mib_name = "hw.realmem"; return(sysctlbyname(usermem_mib_name, &realmem, &len, 0, 0))