Thread View: comp.lang.pascal.borland
2 messages
2 total messages
Started by Dominik Gehl
Wed, 30 Jun 1999 00:00
Turbo Pascal memory
Author: Dominik Gehl
Date: Wed, 30 Jun 1999 00:00
Date: Wed, 30 Jun 1999 00:00
12 lines
1319 bytes
1319 bytes
Hi! Does anybody know exactly how Turbo Pascal 7.0 does the memory management? I have a program with lots and lots of pointers to get running under Windows NT and I always get memory overflows. I think that Turbo Pascal does not use the whole 128MB RAM I have but only the first 16MB. If yes, is there any way to change this? Do I have to compile using TP or TPX. What are the differences? Are there any compiler flags I have to use? Thanks a lot Dominik gehl@iro.umontreal.ca
Re: Turbo Pascal memory
Author: Mike Copeland
Date: Wed, 30 Jun 1999 00:00
Date: Wed, 30 Jun 1999 00:00
30 lines
2477 bytes
2477 bytes
> Does anybody know exactly how Turbo Pascal 7.0 does the memory > management? I have a program with lots and lots of pointers to get > running under Windows NT and I always get memory overflows. I think > that Turbo Pascal does not use the whole 128MB RAM I have but only the > first 16MB. If yes, is there any way to change this? Do I have to > compile using TP or TPX. What are the differences? Are there any > compiler flags I have to use? First, Turbo Pascal 7.0 has access only to Real Memory - the 640K in which programs execute. You can allocate and use several pages of 64KB of Heap data, using pointers, and the total amount of Heap is dependent on several factors: 1. Whether or not you're executing your program in the TP IDE (not a good way to do it if you're using pointers or making Exec calls); 2. How much Real Memory is being allocated to the DOS process you're running. I don't know how NT does it, but you need to maximize this value...and you should be working with 600K+ to have maximum resources available; 3. The value MemAvail returns when you call it as your program executes (affected by whatever's running when you execute your program); 4. The treatment of pointers which have been used and aren't needed any more - are you releasing them? All told, you should be able to use at least 400K of Heap memory (in 64KB chunks), providing you deal correctly with the above issues. You can also use Overlays, to make your program smaller and make even more Heap memory available...depending on the application, of course. Most of all, _don't_ run your program in the IDE, because it consumes an enormous amount of Real Memory while it's in execution - it doesn't swap out when your compiled program executes. Compile to Disk and execute it as a DOS application.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads