Microsoft KB Archive/35720

From BetaArchive Wiki
Knowledge Base


Changing QuickBASIC's SIZE Resource to Help "Out of Memory"

Article ID: 35720

Article Last Modified on 11/21/2006

This article was previously published under Q35720

SUMMARY

QuickBASIC will produce an "Out of Memory" error if you attempt to open a very large source file.

As mentioned in the README.DOC file, Macintosh QuickBASIC initially allocates about one-third of the memory listed in its SIZE resource to the data area (default data area is about 100K). Because the QuickBASIC interpreter loads your program into the data area, programs larger than about 100K can produce an "Out of memory" error.

To correct this problem, change the SIZE resource of Microsoft QuickBASIC (b) or (d) with either of the following:

  1. ResEdit
  2. "Get Info" (COMMAND-I) from the File menu in the desktop of Apple MultiFinder, or System Version 6.00 or later


MORE INFORMATION

For the data area, QuickBASIC sets aside about one-third of the value specified for the application size in the QuickBASIC SIZE resource. The amount of memory QuickBASIC allocates can be changed by altering the SIZE resource. The SIZE resource is in the resource fork of Microsoft QuickBASIC (b) or (d).

If you use Apple Multifinder, or Finder Version 6.1.0 or later, the application memory size can be set by selecting QuickBASIC and executing a "Get Info" (COMMAND-I) from the desktop File menu.

You also may make this change with ResEdit. Open QuickBASIC, and double click SIZE in the resource list. If there is a SIZE id = 0, open it, otherwise there will only be a SIZE id = -1. The memory size information is at the very bottom of this resource, so scroll all the way to the end. The units are in bytes, rather than 1024 bytes (k) as displayed in the Get Info window.

To estimate the size required, multiply the size of your source file by three and add 100k.

Under MultiFinder, this is the size of the memory partition the application resides in and can access. If there is not enough free memory to allocate the amount specified in Application Memory Size, the Suggested Memory Size is used. If there is not enough free memory to satisfy this process, MultiFinder will not start the application. The Finder does not use the SIZE resource.

WARNING: If you change the size to something larger than the memory on your machine, you may get a system error when you start QuickBASIC. If this error occurs, change the memory size to something smaller.


Additional query words: MQuickB

Keywords: KB35720