Re: How can I determine ram in C ?

From: Walter Roberson (roberson_at_ibd.nrc-cnrc.gc.ca)
Date: 08/29/03

  • Next message: Josh Birnbaum: "Re: Irix 6.2 networking problems"
    Date: 29 Aug 2003 02:44:44 GMT
    
    

    In article <3F4EADAC.FE64635F@ntlworld.com>,
    Dr. David Kirkby <drkirkby@ntlworld.com> wrote:
    :I know the hinv command gives a lot of information about a machine,
    :but is there a way to get the same information in C ?

    Yes.

    :I can get the
    :number of CPUs online using sysconf, but I can't find a way to get the
    :ram.

    getinvent() and go through the returned table looking for inv_class == 3:
    those represent memory of various kind. Look then at inv_type
    for the kind of memory: main memory is type 9. The inv_state for that
    entry is the size of main memory in megabytes.

    :Other information, such as CPU, FPU, cache sizes would be useful
    :too.

    Within inv_class 3, use this table:

      inv_type # type inv_state is in hinv prints as

       3 DCACHE bytes Kb
       4 ICACHE bytes Kb
       6 SDCACHE bytes bytes
       7 SICACHE bytes bytes
       8 SIDCACHE bytes Mb

    I wrote some table-driven code in the IRIX 6.2 timeframe to decode
    inventories; it was an extension to some MO (magento-optical) handling
    tools that I wrote that had to be able to search the inventory to
    figure out where the drives were and then runs SCSI senses on
    them to figure out what kinds of drives they were. If you write me
    in your medphys University incarnation, I can make the source available
    to you for research purposes.

    -- 
       Perposterous!! Where would all the calculators go?!
    

  • Next message: Josh Birnbaum: "Re: Irix 6.2 networking problems"

    Relevant Pages

    • Re: disppearing disk drives, faultly programs and slow performance
      ... under processes as using 0 memory and would not show up under the ... Also, almost immediately, Internet Explorer stopped working, the link ... The computer virtually stopped when I tried to update itunes from ... my Cd-rom/DVD-rom drives disappeared. ...
      (microsoft.public.windowsxp.general)
    • Re: Win XP Pro & Disk Thrashing
      ... No Third Party memory management is in use. ... the file in Windows Explorer and select Send to, ... Drives are fully Defragged. ... I had the swap file set so that Windows ...
      (microsoft.public.windowsxp.perform_maintain)
    • Re: Win XP Pro & Disk Thrashing
      ... Have you installed a third party memory managent utility? ... If you right click on the file in Windows Explorer and select Send to, ... Drives are fully Defragged. ... I had the swap file set so that Windows ...
      (microsoft.public.windowsxp.perform_maintain)
    • RE: Insufficient resources exist to complete the requested service
      ... "Mark L. Ferguson" wrote: ... As memory starts going ... associated System Event Log entry and a Hijack this log. ... Drives ...
      (microsoft.public.windowsxp.help_and_support)
    • RE: page file
      ... Managing computer memory ... Windows uses hard drive space to simulate system RAM. ... drives and removing it from slower or heavily accessed drives. ... To change the size of the virtual memory paging file ...
      (microsoft.public.win2000.general)