home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 36 Tips / 36-Tips.zip / alltips.zip / OTSWAP.FAX < prev    next >
Text File  |  1994-11-27  |  15KB  |  332 lines

  1. Info about memory and swapper usage.     7/20/94
  2.  
  3.        File:osotswap.fax 5/3/94
  4.  
  5.        Memory and Swapper information
  6.        ------------------------------
  7.  
  8.        The purpose of this document is to provide information
  9.        about memory and swapper usage.
  10.  
  11.  
  12.        Memory needs
  13.        ------------
  14.  
  15.        - OS/2 will run on 4 MB.  Depending on the application mix,
  16.        and the desired performance, memory requirement needs will
  17.        vary.  In general, the system should have enough memory to
  18.        avoid excessive amount of swapping activity.
  19.  
  20.        - Question:  What are the symptoms of poor performance
  21.        caused by insufficient amount of memory ?  a) Excessive
  22.        amount of hard disk activity which is caused by constant
  23.        swapper activity.  In extreme cases, the disk light will be
  24.        constantly active even when system is not being actively
  25.        used.  b) Performance degradation - It takes an excessive
  26.        amount of time to do anything.  In extreme cases, it might
  27.        take several minutes for the task list to be displayed
  28.        after pressing <Ctrl><Esc>.  Solution:  Adding additional
  29.        memory will alleviate the above symptoms.
  30.  
  31.        Swapper
  32.        -------
  33.  
  34.        - Question:  How much disk space should be allowed for
  35.        swapper file growth ?  Answer:  It depends on the number of
  36.        applications, the kind of applications running and the
  37.        amount of memory in the system.  Symptoms:  If getting
  38.        SWAPPER FULL (if COMMIT=OFF) or LOW MEMORY (if COMMIT=ON)
  39.        messages, then you are not allowing enough free disk space
  40.        to allow for swapper growth.  Performance will drop
  41.        tremendously, because of increased swapper activity, and in
  42.        extreme cases, the system may halt or trap.
  43.  
  44.        - If you are monitoring swapper file size, you will get a
  45.        feel for the size of the typical swapper file size under
  46.        normal system usage.
  47.  
  48.        SYS1477 - PJ13981, PJ09668 and PJ09471
  49.        ---------------------------------------
  50.  
  51.        PJ13981 deals with a potential problem because all OS/2
  52.        processes continue running after receiving a SYS1477
  53.        "Out of Swapper" warning message.  The possibility of a
  54.        system crash exists if these processes continue allocating
  55.        memory.
  56.  
  57.        The SYS1477 Swapper File Full message is just a warning
  58.        message that informs the user that it needs more disk space
  59.        in order for the swapper file to grow.  However, it is not
  60.        designed to allow usage of the system under low disk space
  61.        conditions in the swapper partition without running the risk
  62.        of causing a system failure.
  63.  
  64.        The user should understand that while the SYS1477 message
  65.        is being displayed, all processes continue running.  If any
  66.        one of the processes continues allocating memory while the
  67.        SYS1477 message is displayed, and the user does not respond
  68.        to it quickly enough, may cause OS/2 to run out of memory and
  69.        halt the system with an Internal Processing Error (IPE).
  70.        In very fast machines, or if the system is very busy, it is
  71.        possible for an application to consume the remaining memory
  72.        and cause an IPE before the SYS1477 message has time to
  73.        come up.
  74.  
  75.        SUGGESTIONS TO MINIMIZE THE CHANCES OF PROBLEMS:
  76.        1.  Provide enough disk space to allow for swapper growth.
  77.  
  78.        2.  Larger "minfree" parameter so that the SYS1477 warning
  79.            message is displayed earlier.
  80.  
  81.        3.  Usage of the "commit" parameter. This prevents an
  82.            application from running unless there is enough memory
  83.            and swapper resources for the application to run.  The
  84.            user should understand that the "commit" parameter
  85.            allocates memory and swapper resources when REQUESTED
  86.            by the application.  If this parameter is not used,
  87.            resources are allocated as NEEDED by the application
  88.            to run.
  89.  
  90.        For example: If an application allocates 16mb of memory but
  91.        does not use the memory, then if "commit" is specified it
  92.        will require a total of 16mb of memory and swapper resources
  93.        for the application to run.  If "commit" is not used, it
  94.        might only require 200k of memory and swapper resources to
  95.        run the same application.
  96.  
  97.        SYS0008 message when running memory intensive applications
  98.        ----------------------------------------------------------
  99.  
  100.        - This may be caused by having the swapper file in a
  101.        partition with a large amount of free disk space.  This is
  102.        a known problem that has been fixed and will be
  103.        incorporated in a service pack for OS/2 2.1 or the next
  104.        version of OS/2.  As a work around, place the swapper file
  105.        on a partition with less than 100mb of free space.
  106.  
  107.        How OS/2 addresses RAM above 16M
  108.        -----------------------------------
  109.  
  110.        OS/2 will attempt to address all RAM directly but it can
  111.        be limited by device drivers to 16M of directly addressable
  112.        RAM.  OS/2 queries loaded device drivers (using a
  113.        DOSDevIOCtl, Category 8, function 63h API call) to determine
  114.        if a given device driver can access more than 16M of RAM.
  115.        If any device driver on the system returns that it cannot
  116.        address more than 16M of RAM, then OS/2 will only
  117.        directly address 16M of RAM.  RAM above 16M is
  118.        reserved for an "in memory" swap file which will be used
  119.        before SWAPPER.DAT is used.  Note that if NOSWAP is set in
  120.        the MEMMAN statement, the "in memory" swap file is not
  121.        disabled.
  122.  
  123.        Below are a few reasons that a device driver may not be able
  124.        to address RAM above 16M.  The most common is that the
  125.        device driver is a block device driver (a device driver which
  126.        uses DMA) whose DMA channel is only 24bits and the device
  127.        driver was not programmed to work around the DMA's limitation
  128.        of addressing 16M of RAM.  Another reason is the device
  129.        driver may have been programmed for OS/2 1.3 and is therefore
  130.        subject to the maximum amount of RAM which OS/2 1.3 could
  131.        address which is 16M.  Also if the greater than 16M bit in
  132.        the Device Driver Attributes which are returned from the API
  133.        call is not set, this will occur.
  134.  
  135.        Determining RAM available on ISA systems
  136.        -------------------------------------------
  137.  
  138.        During boot, OS2LDR issues the three BIOS calls mentioned in
  139.        the section below.  If the INT 15 AX=88 returns a value other
  140.        then 16M then this is the amount of RAM OS/2 will address.
  141.        If the INT 15 AX=88 returns 16M then OS/2 will check the return
  142.        from the INT 15 AX=E801 to see if that indicates extra RAM
  143.        available to the system.  Once OS2LDR has determined what
  144.        RAM is available to the system, it passes this to OS2KRNL.
  145.        OS2KRNL initializes the Page Manager which does one final
  146.        check and verifies the RAM which was returned by the BIOS
  147.        really is addressable.
  148.  
  149.        Please note that OS/2 does not attempt to find and use any
  150.        free RAM in the area between 640K and 1M which is reserved
  151.        for hardware.
  152.  
  153.        BIOS calls to determine RAM on non-MCA systems
  154.        -------------------------------------------------
  155.  
  156.        INT 12
  157.        This is the standard industry call to query the BIOS for
  158.        RAM available below 640K.  The call returns into the AX
  159.        register the number of 1K blocks of RAM the system has
  160.        available in this memory area.
  161.  
  162.        INT 15   ;AH=88
  163.        This is the standard industry call to query the BIOS for
  164.        RAM between 1M and 64M.  The call returns into the AX
  165.        register the number of 1K blocks of RAM the system has
  166.        available in this memory area.  The call technically can
  167.        support between 1M and 65M but the standard limits it to
  168.        64M.
  169.  
  170.        INT 15   ;AX=E801
  171.        This is a relatively new call used by Compaq systems as
  172.        well as some other systems to query the BIOS for RAM
  173.        between 16M and 4G.  The call returns into the BX register
  174.        the number of 64K blocks of memory the system has
  175.        available in this memory area.  If there is more than 64M
  176.        of RAM in the system then the INT 15 AH=88 call should
  177.        only return 16M and the programmer should use INT 15
  178.        AX=E801 to find the additional RAM available to the
  179.        system.  INT 15 AX=E801 will also return in the AX
  180.        register number of 1K pages between 1M and 16M so that the
  181.        INT 15 AX=E801 call will return all memory above 1M.
  182.  
  183.        Memory allocations
  184.        ------------------
  185.  
  186.        When an application requests memory the system will give
  187.        the application, regardless of the amount request, 4k
  188.        blocks of memory.  (4096 bytes) out of a 64k segment.
  189.        Example:  if the process requests 5100 bytes, the system
  190.        will allocate a 64k segment of which 8192 bytes can be used
  191.        by this process.  This means that if applications have a
  192.        large number of small memory allocation requests, the
  193.        memory being used by this process may not be what is
  194.        expected.
  195.  
  196.        Memory allocation limits
  197.        ------------------------
  198.  
  199.        As documented in the programming guide volume 1
  200.        (S10G-6261-00) and the red book volume 1 (GG24-3730-00), it
  201.        is theoretically possible to allocate 512mb (Virtual
  202.        address space).  This, of course is based on the systems
  203.        available ram and disk space.  This 512mb area is divided
  204.        into 3 parts:
  205.  
  206.        ---------------    512 MB
  207.        |             |
  208.        | A (64mb)    |    Reserved
  209.        |             |
  210.        ---------------    448 MB
  211.        |             |
  212.        | B (64mb)    |    Shared Virtual address space
  213.        |             |
  214.        - - - - - - - -    384 MB
  215.        |             |
  216.        |             |
  217.        |             |
  218.        |             |
  219.        |             |
  220.        | C           |    Private and shared virtual
  221.        |             |    address space
  222.        |             |
  223.        |             |
  224.        |             |
  225.        |             |
  226.        ---------------    0 MB
  227.  
  228.  
  229.        Section A is reserved for future enhancements to the
  230.        operating system and can be used by changing the "protect"
  231.        option in meman statement located in the config.sys to
  232.        "noprotect".  Section A would then be used by section B.
  233.        Section B is allocated at bootup time for shared memory and
  234.        can grow into section C. Section C is used by private and
  235.        shared memory and the more shared memory is allocated, the
  236.        less private address space will be available.  Please refer
  237.        to the red book or the programming guide Volume 1 for
  238.        further information.
  239.  
  240.  
  241.        Swapper grows and will not shrink
  242.        ---------------------------------
  243.  
  244.        The swapper file will grow when an application is started
  245.        and there isn't enough available ram to run.  The swapper
  246.        file will attempt to shrink back to its original size after
  247.        the application is terminated.  More than likely the size
  248.        of the swapper file will remain bigger.
  249.  
  250.        - Swapper file shrinkage will begin approximately 30
  251.        seconds after there is no system activity assuming no
  252.        process with higher priority is running.
  253.  
  254.        - SWAPPATH's second parameter, in config.sys, defines the
  255.        minimum size of the swapper file.  The swapper file will
  256.        not shrink to a size smaller than the swap file size
  257.        specified by SWAPPATH's second parameter.  Note:  The first
  258.        parameter in the SWAPPATH statement specifies the minimum
  259.        amount of free space in KB that can remain on the partition
  260.        where the swapper.dat file is located before a warning
  261.        notifies you that the swapper file has increased to a size
  262.        that leaves less than this amount on the disk.  *
  263.  
  264.        - Some utilities for analyzing memory and swapper activity.
  265.        a) Theseus2 which comes as part of the SPM/2 product, sold
  266.        by IBM, shows the amount of used and free swapper space.
  267.        It is fully supported by IBM and has many other additional
  268.        functions for analyzing memory and swapper usage.  b)
  269.        OS20MEMU, which can be downloaded for free from the IBM PC
  270.        BBS phone number below) will show the amount of swapper in
  271.        use.  The difference between that number and the size of
  272.        swapper.dat is the free swapper space.  c) DINFO, which can
  273.        be downloaded for free from the IBM PC BBS, monitors
  274.        swapper size and remaining disk space.
  275.  
  276.        - OS/2 determines the optimum initial swapper size
  277.        according to the amount of memory in the system.  This
  278.        value can be overridden by the changing the second SWAPPATH
  279.        parameter in config.sys.
  280.  
  281.  
  282.        Size of swapper file is too big
  283.        -------------------------------
  284.  
  285.        - An application is probably using up a lot of memory.
  286.        Using a utility program like os20memu can help determine
  287.        which program is using an excessive amount of memory.
  288.  
  289.        - There remains the issue where the swapper.dat grows to a
  290.        large value (usually greater than 20 Meg), as a result of a
  291.        large resource allocating application which when terminated
  292.        does not free up all of the memory it requested.  This is
  293.        termed as a "memory leak" originating from the application.
  294.        The manufacturer of the application should be contacted for
  295.        assistance.
  296.  
  297.  
  298.        Memory and Swapper Utilities
  299.        -----------------------------
  300.  
  301.        From IBM PC BBS (free) DINFO - Monitor swapper file and
  302.        remaining disk space.  OS20MEMU - Memory allocation tool.
  303.  
  304.        Utilities from the BBS are provided "as is".  There is no
  305.        customer support provided for these utilities.
  306.  
  307.        Can be ordered from IBM (1-800-426-2255) SPM/2 - Contains
  308.        Theseus2.  More sophisticated than OS20MEMU for analyzing
  309.        memory and swapper.
  310.  
  311.  
  312.        2.x BBS
  313.        -------
  314.  
  315.        Users can download utilities, address questions to IBM or
  316.        other OS/2 users from the following BBS or data services.
  317.  
  318.        IBM PC BBS (free) - (919) 517-0001
  319.  
  320.        TalkLink OS/2 BBS - 1-800-547-1283 for information and
  321.        application.
  322.  
  323.        Prodigy - Call Prodigy for information
  324.  
  325.        CompuServe - Call CompuServe for information.
  326.  
  327.        * Refer to the OS/2 Command reference manual for more
  328.        information.
  329.  
  330.  
  331. 12/31/99
  332.