"Out of Data Space [or Memory]"; OPEN Files Consume Memory (31159)
This article was previously published under Q31159
SUMMARY
When a program is running, each file OPENed with the OPEN statement
takes up memory for the file buffer in DGROUP. If you specify a large
record length (with the LEN= clause), a corresponding large space will
be taken up in DGROUP.
When OPENed file buffers consume all of DGROUP memory at run time,
one of the following error messages will display:
Version In QB.EXE Environment From .EXE Compiled Program
3.00 "Out of memory" "Out of memory in module"
4.00 "Out of data space" "Out of memory in module"
4.00b "Out of data space" "Out of memory in module"
4.50 "Out of data space" "Out of memory in module"
The Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and
OS/2 will behave like QuickBasic Version 4.00b.
To work around this problem, do the following:
- CLOSE each file before OPENing the next. Closing the file will
free up the DGROUP memory that it used.
- Use the CLEAR command to CLOSE all files and erase all
variables.
- Reduce the record length size (LEN=reclen) in the OPEN
statement.
- Make numeric arrays $DYNAMIC instead of $STATIC. This will leave
more space in DGROUP.
Modification Type: |
Minor |
Last Reviewed: |
1/9/2003 |
Keywords: |
KB31159 |
|