Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: memory question again ???

RE: memory question again ???

From: Brian MacLean <bmaclean_at_vcommerce.com>
Date: Thu, 24 May 2001 10:51:54 -0700
Message-ID: <F001.0030DC1D.20010524105139@fatcity.com>

Here is a little C program that works on Solaris:

$ sysconf
Memory->total=5120M free=1596M pct=31 pagesize=8K CPU->total=6 online=6

$ cat sysconf.c
#include <stdio.h>
#include <sys/unistd.h>

main()
{
  int wk1, wk2, wk3, wk4;
  long total_pages, free_pages, pagesize, total_cpus, total_cpus_online;

  total_pages       = sysconf(_SC_PHYS_PAGES);
  free_pages        = sysconf(_SC_AVPHYS_PAGES);
  pagesize          = sysconf(_SC_PAGESIZE);
  total_cpus        = sysconf(_SC_NPROCESSORS_CONF);
  total_cpus_online = sysconf(_SC_NPROCESSORS_ONLN);

  wk1 = (total_pages * (pagesize / 1024)) / 1024;
  wk2 = (free_pages * (pagesize / 1024)) / 1024;
  wk3 = (free_pages * 100) / total_pages;
  wk4 = (pagesize / 1024);

  printf("Memory->total=%dM free=%dM pct=%d pagesize=%dK CPU->total=%d online=%d\n",
     wk1, wk2, wk3, wk4, total_cpus, total_cpus_online );

}

-----Original Message-----
From: Janet Linsy [mailto:janetlinsy_at_yahoo.com] Sent: Thursday, May 24, 2001 10:27 AM
To: Multiple recipients of list ORACLE-L Subject: memory question again ???

Hi,

Thank you all for showing me how to check the Unix memory.  Is there a way to show how much is used and how much is free?

Thank you!

Janet



Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Janet Linsy

  INET: janetlinsy_at_yahoo.com
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051 San Diego, California        -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from).  You may also send the HELP command for other information (like subscribing).
Received on Thu May 24 2001 - 12:51:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US