Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!orion.oac.uci.edu!ucivax!milne From: milne@ics.uci.edu (Alastair Milne) Newsgroups: comp.lang.pascal Subject: Re: Turbo pascal question on memory requirements Message-ID: <280114BD.18912@ics.uci.edu> Date: 9 Apr 91 01:11:25 GMT References: <1991Apr6.150859.9694@bnlux1.bnl.gov> Distribution: na Organization: UC Irvine Department of ICS Lines: 57 In <1991Apr6.150859.9694@bnlux1.bnl.gov> kushmer@bnlux1.bnl.gov (christopher kushmerick) writes: >I use a large subroutine library for the front end of programs that I write. We have a large central unit too. I haven't counted for a while, but I believe it exports about 60 routines, and complex data structures. You can always tell, just by watching how long Turbo keeps compiling the one USES line, when it has reached this unit. >Which would we expect to take more memory: >A program which >1: USES all of the technojock units. >2: A program which itself does not use the technojock units, but which uses > my own units where all of the work is done, and which in turn > use the technojock units. I don't know that there would be a significant difference. In both cases, all the units being used have to be linked in, and I usually find it's in the linking phase that Turbo runs out of memory -- even though I always use disc for linking. What might make a difference is overlaying some of them, if you can. Probably because the overlays get written out to a separate .OVR file, not to the .EXE . Now, try this: go back to the Turbo IDE, and compile again. When it gives you that hateful message that it's out of memory, *press F1*. If memory serves at all, you get a help screen talking about means of decreasing memory use. >In case 1, all of the work is done by procedures in the program. In case 2, >the work has been split up into logically separate units. In case 2, > the program >is just a caller loop and knows nothing about, for example, the technojock >stuff. But the linker still has to put it all together, and still has to handle all the symbols that every unit refers to. >Perhaps my program is just to big. But before I go to the command line >compiler and turbo debugger, I want to amke sure that there is not >some simpler way tio decrease memory requirements. Well, if you feel like living dangerously, you can turn off some of the runtime checks (stack, range, IO); but I prefer not to do this unless it's *really* necessary. >How much will I win by turning of debugging in some of the units? Local >symbols? *Lots* The debugger and the debugging info are very greedy. In Turbo 5.0, this made the difference for me between compiling relatively easily, and not compiling at all. Alastair Milne