Top Navigational Bar

WordPerfect 5.1 Expanded Memory Usage
DocumentID: 650029
Revision Date: 29-Feb-96 8:28:56 PM

The information in this document applies to:
WordPerfect® 5.1 for DOS

Problem

Solutions: This document overviews the way that WordPerfect 5.1 uses expanded memory.

1.      The LIM Expanded Memory Specification

      The term expanded memory as used in this document refers to computer memory at addresses above 1 Megabyte, which is made available for use by DOS programs through adherence to the Lotus/Intel/Microsoft Expanded Memory Specification. There are several versions of the LIM specification -- the most recent version is 4.0, the previous version was 3.2. Computers that use expanded memory do so through an expanded memory manager (a DOS "driver"). For expanded memory to be available for use by WP, the expanded memory manager must adhere to the LIM specification version 3.2 or higher.

2.      How WordPerfect Uses Expanded Memory

      WordPerfect uses expanded memory primarily for three functions: caching of the document virtual files, other file caching including the caching of the code overlay file WP.FIL, and for use by various functions within WP that need workspace.

2.1.      Virtual files

      Virtual files are the user's document(s). As WP's edit buffer in conventional memory fills, portions of the document are saved to expanded memory. When expanded memory fills, the document virtuals begin to be saved to disk. When a document is saved, its contents are written from the edit buffer, expanded memory, and the virtual disk files to the saved file on disk. The ability to channel the virtual files into expanded memory will usually significantly speed up the process of editing a large document.

2.2.      File Caching

      The concept of file caching is to save as much of the file as is reasonable in program memory (conventional or expanded) and thus decrease the number of times the disks must be accessed. With expanded memory present, the size of the file cache area and thus the effectiveness of file caching is greatly increased. In particular, the code overlay file WP.FIL is constantly accessed during a word processing session. With expanded memory present, overall program speed is likely to increase since a section of code that is read into memory (expanded) once is likely to stay there. Thus the next time that code section is needed it can be retrieved from expanded memory rather than from disk. The /R command line switch can be used to load the entire WP.FIL file into expanded memory at program start up, and this will significantly increase the speed of WP.

2.3.      Program workspace

      Many program functions within WordPerfect need a temporary workspace area. Often the size of workspace the function is able to obtain will drastically affect the speed of the operation. A very noticeable example is graphics printing. If conventional memory is limited, printing graphics images can be a very slow process, sometimes taking 30 minutes or more to print an image. If expanded memory is present, the graphics print routines can usually obtain a large expanded memory area in which to work, and this will greatly speed up printing an image. You should know, however, that currently there are not a lot of program functions that make use of expanded memory. The expanded memory cache routines were not available for use by the developers until rather late in the development of WP 5.1. For example, the Print Preview code does not yet utilize expanded memory, and thus some customers may be confused or frustrated because "I have 8 Meg of expanded memory; how come I get this Not Enough Memory error when I try to preview?". We expect that in the future most functions within WP will make use of expanded memory if it is present.

3.      Amount of Expanded Memory used by WordPerfect

3.1.      Maximum allocation

      When WordPerfect starts it will automatically detect whether a LIM 3.2 or higher version of expanded memory is present. If so (and the /NE command line switch was not used) WP will detect the amount of currently available expanded memory. Any expanded memory already in use by other programs will never be used by WP, even if that memory is made available later on in the word processing session. After detecting the current available amount of expanded memory, WP determines and remembers the maximum amount of expanded memory that it will make use of. That maximum amount is 50% of currently available expanded memory if Shell is running, and almost 90% of currently available expanded memory if Shell is not active. This maximum amount can be set by the user using a (second parameter in the ) /W command line switch. WP will never allocate more than that amount of expanded memory and may allocate less if at some time during the word processing session some other program allocates expanded memory that was available at the time WP started.

3.2.      Initial allocation

      Expanded memory is accessed in 16K blocks of memory called "logical pages". When WP initializes its internal cache, it will allocate one logical page. Almost immediately, however, file caching will begin (see File Caching) which will usually allocate an additional number of logical pages until about 120K of expanded memory has been allocated.

3.3.      Growing and shrinking during the word processing session

      As the word processing session progresses WP attempts to make optimal use of the expanded memory available to it. This means that typically the amount of expanded memory allocated to WP will grow steadily until it reaches the maximum allocation amount mentioned above. Exiting from all documents will not necessarily affect this noticeably unless the documents are large. WP assumes that the maximum amount it calculated is available for its use, and it will generally not attempt to free up any expanded memory until that maximum is reached. There are internal program conditions that will release some of the logical pages allocated to WP. WP will detect if it has excess unused logical pages allocated and will release them back to the expanded memory manager. This "shrinking" of the amount of expanded memory allocated to WP will be most noticeable when exiting very large documents.

4.      Expanded Memory "Handles"

      Some customers will want or need to know some of the more technical aspects of how WP utilizes expanded memory. One of those technical issues is the number of expanded memory "handles" used by WP.

4.1.      What is an expanded memory handle?

      A handle is a number that is used to identify a group of expanded memory logical pages. The expanded memory manager assigns the identifying number and communicates that number to the application program (WP in this case). The handle is always used in subsequent communication between the expanded memory manager and WP when some action is to be done for one of the logical pages in that group.

4.2.      How many handles does WordPerfect use?

      Since an expanded memory manager has only a limited number of handles, it is often important to know how many of those handles a program like WP will use, and how many will be left for use by other applications. The number of handles that WP will use depends upon the LIM version that the expanded memory manager supports. If the memory manager is running under the LIM 4.0 specification, WordPerfect will only use a single handle for all of its expanded memory use. If the memory manager is running under the LIM 3.2 specification, WP will use up to but never more than 50% of the number of handles that are available at the time WP starts. The number of handles WP uses does not affect the amount of expanded memory used as described above.

5.      Affect on Conventional Memory

      If expanded memory is present most activity relating to retrieving and saving files will be significantly faster (this includes program execution speed, since the code overlay file WP.FIL is also cached in expanded memory). Additional speed is gained since the virtual files and other files will not have to be cleared from conventional memory if that space is needed for program use. There is, however, one negative affect of having expanded memory. When expanded memory is present, WP must devote an extra conventional memory buffer exclusively for transferring data between the disks and expanded memory. This means that in the case where a user has very little available conventional memory, there can be some situations where there is not enough program memory to execute a requested function. For example, Print Preview does not currently make use of expanded memory, and there are cases where a file will preview without expanded memory and yet give a "Not enough memory" error when previewed with expanded memory present. As WordPerfect evolves, program functions requiring large amounts of memory will make use of expanded memory if it is present, thus alleviating this problem.

6.      Related Command Line Switches

6.1.      /W workspace switch

      An expanded memory parameter has been added to the /w switch, which now has the following format:

      /w-[conventional workspace],[expanded memory workspace]

      An asterisk indicates use all available memory. For example:

/w-120,512       Use 120k for conventional cache workspace and 512k for expanded memory workspace.
/w-,*       Use the default conventional cache workspace and use all available expanded memory.
/w-120       Use 120k for conventional cache workspace and the default workspace for expanded memory.

      If expanded memory isn't available in the user's system, the expanded memory portion of the /w switch is ignored.

6.2.      /R resident switch

      If the /r switch is given, WP will attempt to load the WP.FIL code overlay file into expanded memory. This will significantly increase the speed of WP. In order to use this switch, you must have somewhere close to 600K of expanded memory available for use by WP at the time WP starts. Remember that WP will allocate for its own use only part of the available expanded memory (50% under Shell, almost 90% without Shell). Thus if you have 1 Meg of expanded memory and are running under shell, you will not be able to use /r without explicitly giving WP about 600K of expanded memory with the /w command line switch. Also remember that any expanded memory that is already in use by other programs at the time WP starts will not be considered available for use by WP.

6.3.      /NE no expanded memory switch

The use of expanded memory can be turned off using the /NE switch.

Answer:

Details:


Product specifications, packaging, technical support and information (*Specifications*) refer to theUnited States retail English version only. Specifications for other versions may vary. All Specifications, claims, features, representations, and/or comparisons provided are correct to the best of our knowledge of the date of publication, but are subject to change without notice.OUR MAXIMUM AGGREGATE LIABILITY TO YOU AND THAT OF OUR DEALERS AND SUPPLIERS IS LIMITED. IT SHALL NOTEXCEED THE AMOUNT YOU PAID TO ACCESS THE INFORMATION. SEE LEGAL DISCLAIMER.