Borland Online And The Cobb Group Present:


December, 1994 - Vol. 1 No. 12

Running MAKE on a low-memory system

In the accompanying article, Debugging OWL 2.0 applications - Building a diagnostic version of the OWL 2.0 library we show how you can use the MAKE.EXE utility that ships with Borland C++ 4.0 to build debugging or diagnostic versions of the OWL code library. However, if you try to build the OWL library files on a machine that doesn't have a large amount of RAM, the MAKE utility may not be able to create those files.

For example, you'll typically need more than 8 Mb of RAM to build a diagnostic version of the OWL DLL. This is particularly true when the MAKE utility begins linking the resulting object (OBJ) files.

Fortunately, if you have enough disk space, you can use Windows' virtual memory system to simulate the appropriate amount of RAM. Here, we'll show how you can increase the amount of virtual memory that's available to Windows, and how to modify the DOS command prompt to use the additional memory when you run the MAKE utility.

Increasing virtual memory

To simulate more memory than your system actually has in RAM, Windows creates a special swap file that it uses to temporarily hold data and code. To begin adjusting the size of this file, double-click on the 386 Enhanced icon in the Windows Control Panel (the Control Panel is in the Main program group).

When the 386 Enhanced dialog box appears, click the Virtual Memory... button. When the Virtual Memory dialog box appears, click the Change>> button, then enter 16000 in the New Size entry field, as shown in Figure A. (For Windows to use a swap file this large, you'll need to have at least 32 Mb of free disk space. This is because Windows will typically use half the available disk space for the swap file.)


Figure A - You use the Virtual Memory dialog box to increase the memory available to Windows.

To save this change to the swap file, click OK. Now, Windows will ask you to confirm that you want to change the virtual memory settings. Click Yes.

Finally, Windows will display a dialog box that asks if you want to restart Windows or if you want to continue with the current virtual memory settings until the next time you start Windows. Either click Restart Windows or do the following:

  1. Click Continue.
  2. Exit the Virtual Memory control panel.
  3. Shut down any other applications.
  4. Exit Windows.
  5. Restart Windows.

As soon as Windows finishes restarting, it will use the new virtual memory setting.

Modifying the DOS prompt

To allow the MAKE utility to use the additional virtual memory, you'll open the Program Information File (PIF) Editor application and modify the settings for the Windows DOS prompt. To launch the editor, double-click on the PIF Editor icon in the Main program group.

When the PIF Editor's main window appears, choose Open... from the File menu, enter DOSPRMPT.PIF in the File Name entry field, and click OK. When the PIF Editor's main window reappears, you'll see the current settings for the Windows MS-DOS Prompt icon.

In this window, enter -1 in the XMS Memory: KB Limit entry field, as shown in Figure B. This will allow the DOS prompt to use as much extended memory as it can from the virtual memory pool.


Figure B - You use the PIF Editor to increase the available memory for the Windows DOS prompt.

To save this change to the DOS prompt's PIF file, choose Save from the File menu. To exit the PIF Editor, choose Exit from the File menu. Now, you can run the MAKE utility from Windows' MS-DOS prompt.

Return to the Borland C++ Developer's Journal index

Subscribe to the Borland C++ Developer's Journal


Copyright (c) 1996 The Cobb Group, a division of Ziff-Davis Publishing Company. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff-Davis Publishing Company is prohibited. The Cobb Group and The Cobb Group logo are trademarks of Ziff-Davis Publishing Company.