Getting Around Memory Problems

Depending on the size of your Help file and the computer you are using to build on, you may encounter out-of-memory problems during compilation. Although there is no single solution that addresses all out-of-memory conditions, the following list offers some suggestions you might try to ensure that your Help file will build successfully:

nIf possible, compile without compression.

The Help file will build fastest when no compression is used. Compressing the Help file can take up to ten times as long to build as an uncompressed file, depending on the content. In most cases, you can build with no compression while you’re developing the Help file, and use compression for only the final builds of the product.

nCompile in a Windows MS-DOS box rather than from the MS-DOS prompt.

In most instances, you are better off running the Help compiler in a Windows MS-DOS box because HC31.EXE uses extended memory, which is not always available in regular MS-DOS but is available in an MS-DOS box under enhanced mode Windows. To verify that you are using the enhanced version of the compiler, you can run the compiler and look at the copyright message. It should include the word “extended” after the version number.

nClose other applications that are also running.

Frequently you want to have Word for Windows running so that you can edit your RTF source files and then do a quick compile. However, if you have a limited amount of memory in your computer, you may have to close Word for Windows or all other running applications to free enough memory to complete the build.

nCompile the Help file under OS/2 or use HCP.EXE under MS-DOS.

OS/2 does not have the MS-DOS 640K memory limitation and manages available memory much more efficiently than does MS-DOS. If you do not have an OS/2 machine, you can use the DPMI version of the Help compiler (HCP.EXE), which should produce similar results under MS-DOS.

nBe sure that you have sufficient free disk space.

Sometimes the Help compiler can run out of memory if the disk runs out of space. Compare the amount of free disk space you have with the size of your topic files. If you are compiling with compression, you may need as much free disk space as five times the size of your source files. This requirement can be more or less (usually less), depending on the Help file. Compiling without compression also reduces the amount of disk space the compiler requires.

nReplace any inline bitmaps in the topic files with bitmap references.

The 3.1 Help compiler fragments memory when compiling bitmaps under
MS-DOS, which often causes out-of-memory problems. Therefore, if you have pasted any bitmaps directly into the topic files, you should replace them with bitmap references. If the pasted-in bitmaps are larger than 64K, the compiler will always run out of memory during the build. If you have severe memory problems, you may have to limit the number of bitmaps you include in the Help file.

nIf you are building with compression, perform partial builds until you achieve a successful build of the Help file.

To perform a partial build, you edit the Help project file and comment out specific lines (topic files) in the [FILES] section. Commenting out topic files will produce an incomplete Help file with unresolved jumps and other problems; however, the compiler may be able to create a .PH file with compression information. After you have a phrase file, you can build the Help file again and include all the topic files. (Remember to set OLDKEYPHRASE=yes in the Help project file before building the Help file.) The compiler will create a working Help file with some level of compression. If necessary, you can use the phrase file with several topic file subsets to compress the complete Help file.

nIf you are building a version 3.0 Help file with compression, use the 3.1 Help compiler to create the phrase file.

The 3.0 Help compiler often runs out of memory when creating a phrase file (.PH) for large Help files, even when compiling under OS/2. That is because creating the phrase file is a very memory intensive process, and phrase files over 32K cause the build to fail. However, this is not usually a problem when using the 3.1 Help compiler. So, if you are having trouble compiling a file with the 3.0 Help compiler, you can delete the 3.0-generated phrase file and use the 3.1 compiler to generate a phrase file. After you have a phrase file, you can build the Help file again with the 3.0 compiler. (Remember to set OLDKEYPHRASE=yes in the Help project file before building the Help file so the 3.0 compiler will not try to create a phrase file.)