Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Virtual Memory/Swap File

May 16, 2005 10:07AM PDT

I have read the following tweak for Windows (2000 & XP) and have been wondering whether I could safely apply it to Windows 98SE.....

My Computer - Right click - Properties - Performance - Virtual Memory - Change....Custom Size (In Win 98 this appears as ... Let me specify my own Virtual Memory Settings)....

Recommended settings: "Set the swap file at a fixed size of at least 1.5 times the amount of RAM the machine has, unless the computer has a lot of RAM. For systems with 256MB of RAM set to 384MB, for 512 RAM set to 512MB and for IGB of RAM set to 768MB".

I am running Pentium III, 550mhz. Last week I had my pc formatted and Win98se reinstalled and RAM increased to 512MB.

Right now, running Win98se, Zonealarm (free) Avast! (free) Mozilla Firefox and SpywareBlaster (background), using System Monitor I get the following readings....

Memory Manager - other Memory 129MB out of 244MB
Memory Manager - Unused physical memory 339MB out of 488MB
Memory Manager - Allocated memory 213MB out of 244MB
Memory Manager - Swappable memory 84MB out of 97MB
Memory Manager - Swapfile size 88MB out of 244MB
Memory Manager - Disk cache size 83MB out of 97MB

Thank you in advance for any advice/help being offered.

Aenea.

Discussion is locked

- Collapse -
Swap Memory
May 16, 2005 5:19PM PDT

I read quite some time back that the Virtual Memory is to be around 2.6 times the RAM for Win95.

I'm following the same for Win98 SE. I have created a 1GB partition (The first) on my second HDD and have manually set the Virtual RAM to 666 MB. I have a 256 MB RAM.

There are 2 specific advantages I've seen. First, the System drive, C: is less fragmented and can be defragmented better since there is'nt a immovable file of this size. Second, I have an additional space of this size that is available on my C: drive that becomes necessary when running some Audio / Video programs where one cannot specify the location of temp files - they are by default C: drive.

I have not experienced any disadvantages in relocating the Virtual Memory to another drive.

- Collapse -
Swap File.
May 16, 2005 10:12PM PDT

1. Click Start, Settings, Control Panel, double-click the System icon, click the Performance tab and finally, click the Virtual Memory button near the bottom.

a. Click the radio button for ''Let me specify my own virtual memory setting'' (Click to see an example screenshot).

b. There are three choices:

(1) Hard disk: - Select where you want the Swap file located. Although the system defaults usually provide the best performance, you can adjust the parameters used to define the Swap file. Completely disabling virtual memory might cause the computer to stop operating properly. You might not be able to restart the computer, or system performance might be degraded. Something I wouldn't recommend.

(2) Minimum: - perhaps 60-80MB

(3) Maximum: - perhaps 100MB

c. Notes:

(1) Windows 98 uses a special file on your hard disk called a ''virtual memory swap file'' (or paging file), usually referred to by many simply as, ''Swap file''.

(2) Windows 98 maintains a resident permanent swap file on the boot drive at all times. Generally the swap file is located in the \windows folder but may be relocated anywhere else.

(3) Windows cleans up resources that have not been freed to help reduce system resource limitations. When it determines that an application that owned certain resources no longer needs those resources in memory, it reallocates remaining data structures freeing the resources for use elsewhere in the system.

(4) The swap file is self-tuning and the cache size adjusted as determined by the operating system or other elements of the system environment which provides the best performance for the overall configuration.

2. The most effective method to make the Windows managed paging file contiguous is to frequently defragment hard drive free space. This allows a paging file to dynamically shrink and grow in the contiguous free space. For example, when you first start Windows, and depending on the amount of memory installed on the computer, the paging file may or may not be used until needed. When a program is started, the paging file will begin to grow and as you close programs, the paging file will shrink accordingly.

Note: Windows pages through the paging file in 4-kilobyte (KB) blocks whether the paging file is contiguous or not. For example, if Windows reads 40 KB of contiguous space from the disk, the paging file is actually read 10 separate times, once for each 4-KB block. So, setting it larger than necessary is not very advantageous and certainly not recommended under any circumstances.

Caveats:

? The Windows 9x paging file is not affected by defragmenting. Fragmentation does not noticeably impact its performance because of the way the operating system uses the paging file. The advantage of defragmenting, is to insure all other files are contiguous.

? ''Various Error Messages Displayed and Slow Windows Performance When Virtual Memory Is Enabled (Q239094).''

Notes:

a. When programs are installed on a computer, files may be broken up over multiple locations on the hard disk and is called fragmentation. If fragmentation occurs, performance of programs is slower. The Disk Defragmenter tool optimizes the performance of a computer by reorganizing files into contiguous blocks. When the Disk Defragmenter tool completes the defragmentation, performance of programs is faster because the files are arranged closer together.

b. When a setup or install program is run, the process may require space on a drive containing the swap file which could exceed available space if it is set to large. Instances of this sort, Windows does not control the swap file parameters and the setup or installation may fail with an error messages similar to ''There is not enough free space'', or simply not complete the process with no error message at all.

3. What size should the swap file be?

a. ''SWAPSEE v1.20 - Windows Swapfile Size Monitor is a nice utiltiy to have.

b. Download this tiny utility, which is specially designed to monitor and report the current used size of the Windows Swap file. It is also advantageous a suitable diagnostic tool to monitor large memory hogging applications -- which slows things down when there is insufficient memory & system resources and is perfect for determine a reasonable size setting for a user's given swap file based on their particular system -- a very nice utility to have.

c. Run this application resident for a few days and keep tabs on your personal use of the system and the maximum swap file size usage. Set the swap files setting somewhere comfortable based on the statistical use -- a few megabytes above, and you should be happy with the system responds. Many, many times you'll read where users suggest the old process of setting a swap file to 2-1/2 times the installed memory. I'd hate to think of the wasted hard drive space utilized when a system has as much as 500MB, or even 1GB of onboard memory.

4. Bottom Line:

a. It should not matter where on a hard disk you put the swap file -- inner rim vs outer rim, as far as speed goes.

b. IMO, put the swap file on the second disk if possible and on a partition that does not get fragmented much and don't worry about it. And, if put on a partition or drive which sees little use otherwise, it does not really need to be of a fixed size because there would be very little, if any, reading and writing going on otherwise.

5. Why care where the swap file resides on a single disk.

a. A suggestion for minimizing average seek time is to locate the swap file near the geographical center of the hard disk. This may be preferred in a situation where data is used all around the hard disk and where a second physical hard disk for the swap file is unavailable. By putting the swap file in the center of the disk the average seek distance to the swap file from a random spot on the disk is minimized. The easy way to do this is to split the disk into two equal partitions and put the swap file as the first file on the second partition.

b. I don't know who the guru was who posted the following, but I have to agree with the analogy:

When this swap file is being accessed there is obviously something going on elsewhere on the disk, right? So, taking that into consideration one could assume that the arms are not at rest and somewhere on the disk (most of the time) and not at rest where one would think - and the inner and outer rim are moving at the same speed, right? Although the read/write arms have a greater distance to travel on while writing on the outer edge it will not make any noticeable difference which partition you put the swap file unless you had another physical disk that is not being accessed as much as the first.

6. Optimizing File System Performance:

a. Click Start, Settings, Control Panel, and double-click the System icon.

b. Click the Performance tab, and then click the File System button.

c. In the ''Typical role of this computer:'' box, (Click to see an example screenshot), select the most common role for this computer and then click OK.

d. ID and definitions:

(1) Desktop computer - A normal computer acting primarily as a network client, or an individual computer with no networking. This configuration assumes that there is more than the minimum required RAM, and that the computer is running on power (rather than battery).

(2) Mobile or docking system - Any computer with limited memory. This configuration assumes that RAM is limited and that the computer is running on battery, so the disk cache should be flushed frequently.

(3) Network server - A computer used primarily as a peer server for file or printer sharing. This configuration assumes that the computer has adequate RAM and frequent disk activity, so the system is optimized for a high amount of disk access.

e. Each disk performance profile adjusts the values of the following file system settings in the registry. For example:

(1) PathCache specifies the size of the cache that the virtual file allocation table (VFAT) can use to save the locations of the most recently accessed directory paths. This cache improves performance by reducing the number of times the file system must seek paths by searching the file allocation table. The number of paths is 32 for the Desktop computer profile, 16 for Mobile or docking system, and 64 for Network server.

(2) NameCache stores the locations of the most recently accessed file names. The combined use of PathCache and NameCache means that VFAT never searches the disk for the location of cached file names. Both PathCache and NameCache use memory out of the general system heap. The number of file names is about 677 (8 KB) for the Desktop computer profile, 337 (4 KB) for Mobile or docking system, and 2729 (16 KB) for Network server.

(3) BufferIdleTimeout, BufferAgeTimeout, and VolumeIdleTimeout control the time between when changes are placed in the buffer to when they are written to the hard disk.

7. Notes:

a. Each process for ''Memory Paging'' is allocated a unique virtual address space of 2 gigabytes (GB). The upper 2 GB is shared, while the lower 2 GB is private to the application. This virtual address space is divided into equal blocks, or pages.

b. Demand paging is a method by which code and data are moved in pages from physical memory to a temporary paging file on disk. As the information is needed by a process, it is paged back into physical memory on demand.

c. To support a 16-bit operating environment including Windows 3.1 and MS-DOS, the Intel processor architecture uses a mechanism called a segment. Segments reference memory by using a 16-bit segment address, and a 16-bit offset address within the segment. A segment is 64 KB in size, and performance of both applications and the operating system suffer for accessing information across segment boundaries. Windows 98 supports this memory model for backward compatibility to Win16-based applications that were written for it by providing emulation by the Win16 subsystem.

d. For the support of Win32-based applications and features, Windows 98 uses the 32-bit capabilities of the 80386 (and later) processor architecture to support a flat, linear memory model for 32-bit operating system functionality and Win32-based applications. A linear addressing model simplifies the development process for application vendors and removes the performance penalties imposed by the segmented memory architecture. With this addressing model, it allows full use of the 4 GB of addressable memory space for all 32-bit operating system components and applications. Each 32-bit application can access up to 2 GB of addressable memory space, enough to support the largest desktop application.

e. Although most MS-DOS-based applications run well in Windows 98, and can run concurrently with other Win32-based and Win16-based applications, a small number of MS-DOS-based applications require exclusive access to system resources to run. The Virtual Memory Manager that creates for the application this exclusive operating environment, called MS-DOS Mode. When an MS-DOS-based application runs in MS-DOS Mode, no other applications or processes may compete for system resources ? all resources are at the exclusive access of the MS-DOS-based application.

f. Optimizing Conventional Memory: (Should there be anything you're interested - here's a tidbit)

(1) The methods for conventional memory management under Windows 98 are the same as for MS-DOS 6.x:

(a) In Config.sys, load himem and emm386 (using either the ram or the noems switch) and load any required real-mode drivers and applications using DeviceHigh or LoadHigh statements.

(b) Remove as many real-mode drivers and TSRs from Config.sys and Autoexec.bat as possible, and instead use new protected-mode drivers and applications created for Windows 98.

(c) Use buffershigh, fcbshigh, fileshigh, lastdrivehigh, and stackshigh to ensure that reserved memory is taken out of the upper memory area.

(d) Do not load SMARTDRV in your configuration files, except in configuration files for an application that you run in MS-DOS mode. Windows uses an improved method for disk caching, so loading smartdrv typically wastes memory that could be used by MS-DOS-based applications.

(2) You can still run the MEMMAKER utility provided with MS-DOS 6.2x to load real-mode drivers in the upper memory blocks (UMBs). This utility is available in the Tools\Oldmsdos directory on the Windows 98 compact disc.

(3) Also, MS-DOS Mode and Performance:

(a) Do not assume that running an MS-DOS-based application in MS-DOS mode provides better performance. When an application runs in MS-DOS mode, Windows and all of its protected-mode drivers are unloaded, so the application is running in real mode with exclusive use of the computer's resources.

(b) Although this might help with a few applications that otherwise cannot run under Windows, it does not benefit performance overall, because the application does not get the benefit of protected-mode drivers, VCACHE, 32-bit disk access, and so on. Also, real-mode device drivers must be loaded, reducing the amount of conventional memory available to the application.

8. Supplemental reading:

a. ''INFO: The Windows 98 PageFile_Call_Async_Manager Service (Q223294).''

b. ''Microsoft TechNet, Chapter 26 - Performance Tuning.''

c. ''Windows 98 Second Edition May Hang Due to System.ini Entry (Q233036).''

- Collapse -
Just my opinion.
May 17, 2005 12:44AM PDT

Your statement.

I am running Pentium III, 550mhz. Last week I had my pc formatted and Win98se reinstalled and RAM increased to 512MB.
--------------

Hmmm.
No insult intended but I don't think your a good candidate to be playing around with the swap file.

If you run this swap file thing through google there is a whole bunch of reading but what you'll see quite often is "let windows handle it".

Gearheads play with the swap file to make it fit the way they run the machine.

For GP usage windows does a good job.