Article View: comp.lang.pascal.borland
Article #260Re: Turbo Pascal memory
From: Bob
Date: Tue, 06 Jul 1999 00:00
Date: Tue, 06 Jul 1999 00:00
39 lines
2793 bytes
2793 bytes
Mike Copeland wrote: > 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. The easiest way to get around these limitations would be to use a 32-bit compiler such as p32 or tmt-pascal, however if you don't want to (or can't) use these, then you could try using EMS. EMS is one way that has been developed to utilise the memory above the 1 meg limit. I'm not sure if tp7 can handle pointers to EMS memory or anything (i've never used it myself), but Telemachos of Peroxide has produced a tutorial on how to use EMS (it is aimed towards graphic programs, but i guess the principle is the same). It's called PXDTUT2.ZIP, you sould find it if you search altavista or whatever. Hope this helps ... - Bob
Technical Details
Message-ID:
<3780BAA0.E304087D@unsw.edu.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<UKre3.16340$U4.829299@carnaval.risq.qc.ca> <MPG.11e4a23a4229c806989c43@news.primenet.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111659,d7888456b702217d X-Google-Attributes: gid111659,public X-Google-Thread: 108ebd,d7888456b702217d X-Google-Attributes: gid108ebd,public From: Bob <michael@unsw.edu.au> Subject: Re: Turbo Pascal memory Date: 1999/07/06 Message-ID: <3780BAA0.E304087D@unsw.edu.au> X-Deja-AN: 497386170 Content-Transfer-Encoding: 7bit References: <UKre3.16340$U4.829299@carnaval.risq.qc.ca> <MPG.11e4a23a4229c806989c43@news.primenet.com> Organization: University of New South Wales X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.pascal.borland,borland.public.turbopascal