Title: RE: memory question again ???

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:[EMAIL PROTECTED]]
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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to