OSOTSWAP - MEMORY AND SWAPPER INFORMATION FOR OS/2 2.1 AND OS/2 2.11 01/26/96 ======================================================================= Memory and Swapper Information for OS/2 2.1 and OS/2 2.11 ======================================================================= Please Read Entire Document for Full Explanation of Procedures -------------------------------------------------------------- DESCRIPTION This document contains memory and Swapper information. RESOLUTION Memory ------ OS/2 runs on 4 MB. Depending on the application mix and the desired performance, memory-requirement needs vary. Generally, the system should have enough memory to avoid excessive amount of swapping activity. What are the symptoms of poor performance caused by insufficient memory? A. Excessive amount of hard-disk activity caused by constant Swapper activity. In extreme cases, the disk light might be constantly active even if the system is not being actively used. B. Performance degradation. It takes an excessive amount of time to do anything. In extreme cases, it might take several minutes for the Task List to be displayed after pressing Ctrl+Esc. Solution: Adding memory alleviates the above symptoms. Swapper ------- How much disk space should be allowed for Swapper-file growth? A. It depends on the number of applications, the kind of applications running, and the amount of memory in the system. Symptoms: If you are getting "SWAPPER FULL" messages when COMMIT is set to OFF, or "LOW MEMORY" messages when COMMIT is set to ON, you are not allowing enough free disk space for Swapper growth. Performance drops tremendously because of increased Swapper activity, and in extreme cases, the system might halt or trap. If you are monitoring the Swapper-file size, you learn the typical Swapper-file size under normal system usage. Memory Allocations ------------------ When an application requests memory, the system provides 4 KB blocks of memory (4096 bytes) out of a 64 KB segment, regardless of the amount requested. Example: If the process requests 5100 bytes, the system will allocate a 64 KB segment, of which 8192 bytes can be used for this process. If applications have a large number of small memory-allocation requests, memory being used by this process might not be what is expected. Memory Allocation Limits ------------------------ As documented in volume 1 of the Programming Guide (S10G-6261-00) and volume 1 of the Redbook (GG24-3730-00), it is theoretically possible to allocate 512 MB (virtual address space). This, of course is based on the system's available RAM and disk space. This 512 MB area is divided into 3 parts: --------------- 512 MB | | | A (64 MB) | Reserved | | --------------- 448 MB | | | B (64 MB) | Shared Virtual address space | | - - - - - - - - 384 MB | | | | | | | | | | | C | Private and shared virtual | | address space | | | | | | | | --------------- 0 MB Section A is reserved for future enhancements to the operating system and can be used by changing the PROTECT option in the MEMMAN statement of the CONFIG.SYS file to NOPROTECT. Section A would then be used by section B. Section B is allocated at startup time for shared memory and can grow into section C. Section C is used by private and shared memory, and the more shared memory that is allocated, the less private address space will be available. For more information, see the Redbook or the Programming Guide. Swapper Grows and Will Not Shrink --------------------------------- The Swapper file will grow when an application is started and there isn't enough available RAM to run. When the application ends, the Swapper file attempts to return to its original size. However, it probably will remain larger. The Swapper file begins to shrink approximately 30 seconds after there is no system activity, assuming no process with a higher priority is running. The minimum size of the Swapper file is defined by the second parameter of the SWAPPATH statement in the CONFIG.SYS file. The Swapper file will not shrink smaller than this size. Note: The first parameter in the SWAPPATH statement specifies the minimum amount of free space (in KB) that can remain in the partition where the SWAPPER.DAT file is located before a warning notifies you that the file has increased to a size that leaves less than this amount on the disk. Some Utilities for Analyzing Memory and Swapper Activity -------------------------------------------------------- THESEUS2, which comes as part of the SPM/2 product, can be ordered from IBM at 1-800-426-2255. It shows the amount of used and free Swapper space, and has many other functions for analyzing memory and Swapper usage. OS20MEMU, which can be downloaded from the IBM PCC BBS at 919-517-0001, shows the amount of Swapper space in use. The difference between that number and the size of SWAPPER.DAT is the free Swapper space. DINFO, which can be downloaded for free from the IBM PC BBS, monitors Swapper size and remaining disk space. Utilities from the BBS are provided "as-is." No customer support is provided. Note: OS/2 determines the optimum initial Swapper size according to the amount of memory in the system. This value can be overridden by the changing the second SWAPPATH parameter in the CONFIG.SYS file. Size of the Swapper File Is too Big ----------------------------------- An application is probably using up a lot of memory. Using a utility program such as OS20MENU can help determine which program is using an excessive amount of memory. There also is the case where the SWAPPER.DAT file grows to a large value (usually greater that 20 MB), as a result of a large resource-allocating application that, when terminated, does not free up all of the memory it requested. This is termed as a memory leak originating from the application. Contact the manufacturer of the application for help. If you are getting "SWAPPER FULL" messages when COMMIT is OFF, or "LOW MEMORY" messages when COMMIT is ON, you are not allowing enough free disk space for Swapper growth. Performance drops tremendously because of increased Swapper activity, and in extreme cases, the system might halt or trap. If you are monitoring the Swapper-file size, you learn the typical Swapper-file size under normal system usage. SYS0008 Error Message when Running Memory-Intensive Applications ---------------------------------------------------------------- This might be caused by having the Swapper file in a partition with a large amount of free disk space. This is a known problem that has been fixed. As a work-around, place the Swapper file in a partition with less than 100 MB of free space. SYS1477--The Partition Containing SWAPPER.DAT Is Full ----------------------------------------------------- A potential problem might occur because all OS/2 processes continue running after receiving a SYS1477 warning message. The possibility of a system crash exists if these processes continue allocating memory. The SYS1477 message is just a warning to inform you that more disk space is needed for the Swapper file to grow. However, it is not designed to allow usage of the system under low disk-space conditions in the Swapper partition without running the risk of causing a system failure. You should understand that while the SYS1477 message is being displayed, all processes continue running. If any one of the processes continues allocating memory while the SYS1477 message is displayed, and you do not respond to it quickly enough, OS/2 might run out of memory and halt the system with an Internal Processing Error (IPE). In very fast systems, or in a system that is very busy, it is possible for an application to consume the remaining memory and cause an IPE before the SYS1477 message has time to appear. Suggestions for Minimizing the Chances of Problems -------------------------------------------------- 1. Provide enough disk space to allow for Swapper growth. 2. Make the minfree parameter larger so the SYS1477 message is displayed earlier. 3. Use the COMMIT parameter. This prevents an application from running unless enough memory and Swapper resources exist for the application to run. You should understand that COMMIT allocates memory and Swapper resources when REQUESTED by the application. If this parameter is not used, resources are allocated as NEEDED by the application to run. Example: If an application allocates 16 MB of memory but does not use the memory, if COMMIT was used, a total of 16 MB of memory and Swapper resources would be required for the application to run. If COMMIT was not used, only 200 KB of memory and Swapper resources might be required to run the application. Memory and Swapper Utilities ---------------------------- OS20MEMU, which can be downloaded from the IBM PCC BBS at 919-517-0001, shows the amount of Swapper space in use. The difference between that number and the size of SWAPPER.DAT is the free Swapper space. DINFO, which can be downloaded for free from the IBM PC BBS, monitors Swapper size and remaining disk space. Utilities from the BBS are provided "as-is." No customer support is provided. THESEUS2, which comes as part of the SPM/2 product, can be ordered from IBM at 1-800-426-2255. It shows the amount of used and free Swapper space, and has many other functions for analyzing memory and Swapper usage. Additional Information ---------------------- You can download utility programs, or address questions to IBM or other OS/2 users from the following BBS or data services: * IBM PC BBS (free): 919-517-0001. * TalkLink OS/2 BBS: 1-800-547-1283 for information and application. * Prodigy: Call Prodigy for information. * CompuServe: Call CompuServe for information. * The online OS/2 Command Reference. ______________________________________________________________________ IBM disclaims all warranties, whether express or implied, including without limitation, warranties of fitness and merchantability with respect to the information in this document. By furnishing this document, IBM grants no licenses to any related patents or copyrights. Copyright (c) 1994, 1996 IBM Corporation. Any trademarks and product or brand names referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information.