We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Pascal R6009 Problem

chauntry asked
Medium Priority
Last Modified: 2010-04-16
We are running a Pascal 7.0 application across a Novell network.  When trying to do a Novell capture within our application, we are getting an R6009 runtime error - not enough space for environment.  We have looked at the PAQ on the C problem which says about removing SET options, but this is not possible.

We are running in a dos prompt on Windows 95, and the system works fine on one machine, but not on any others with what appears to be identical setups!  We've also tried on a DOS machine which produced the same error.

Any other solutions?
Watch Question

TP programs mayneed easily over 550KB free conventional memory. Maybe you should try using a clean boot disk to give as much mem as possible

I have had several environment problems in the past and I suggest you look at your compiler directives to reserve some memory when you compile your program in Turbo Pascal. You can also overlay your program so that it does not use up so much memory. The EXE can sometime be huge under TP but all the exe is not loaded until it is needed if overlayed. I forget the compiler directive that limits memory but you can add it to the begining of your source code to limit the memory used during runtime thereby giving up some memory usage to allow for more environment space. Hope this helps.

Try to use Memmaker programme which exist in Dos directory.
This program can increase dos memory up to 700 Kb.

Motaz from Sudan.

Motaz: No PC has more than 640KB :P
Sometimes it is possible to convert some high memory to be used in the 640Kb, so you may get more than 640Kb in your computer.

oh, never heard that

Hello Omsec.

Dos can access up to 1 MRAM, because address represented by 20 bit; that mean 2^20 which equevelant to  1048576. But memory above 640 can be accessed only with special programes.

You can chech that by use Memmaker in proper way.


Motaz from Sudan


Try to increase the size of the environment. Add the following line in your CONFIG.SYS:
Check the DOS Manual, though, because I am not sure about the syntax of the /E option.


Thanks for all the comments people.  We've tried the /E on command.com but to no avail.  We have the source code to the program and tried changing the $M directive at the top.  It seems that if we set it to one figure (109312) we get the R6009 error when the capture runs, but if we up it one to 109313, we get a Program To Big To Fit In Memory error when the capture runs.  We've tried to get more base memory but that didn't help either.  We're running out of ideas (and hair!). Any other suggestions?  Keep them coming cause they are much appreciated.
A. Are you using overlays? DPMI? Any unclear asm directives?
B. What is the size of the code and the executable program?

Could you be more specific about your application? Does it only launches another capture application or it does everything?


Yes, we are using overlays, but not DPMI, and we have no unclear asm directives.  The compiler says 118672 bytes of code, and 60774 bytes of data.  The .exe is 152kb and the .ovr is 209kb.  The program has to print things across the network and so performs a capture before it prints because it can print to many different print jobs and queues, depending on what is being printed.  That is why we can't just do a capture before we kick off the program.  Thanks for all the comments.  


I'll try to keep upping the points as we earn them.

Try to build the application as Protected Mode executable.
I don't sure, but I think your problem has something with the overlays you're using.
Can you recompile the program using units instead of overlays?

Since you're using '95, have you tried modifying the properties of the shortcut to your DOS program, ie adjusting memory allocation in there. Surely your program only really needs 361k of conventional memory, do you really need to use overlays at all ?
Unlock this solution and get a sample of our free trial.
(No credit card required)


Adjusted points to 200


Thanks.  We haven't tried the idea yet but it is the most hopeful and original idea yet.  Why didn't we think of it?
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.