[comp.lang.pascal] TP - memory usage

) (10/30/89)

Hello world,

I'm writing a program in TurboPascal v5 and have, since I'm a novice
at the PC's memory limitations, encountered a problem (at least I think
it could be a problem :-)). How do I know how much of the computers
memory a program is going to use (no dynamic allocation), and how does
one go about to test this? I'd like the program to do something like
"if mem_avail > size_of(this_program) then begin(program) else error(message)"
I have some ideas of how to do, but I don't know how to create the
environment to test them in :-) I've read the manual, yes, but I found
no hints there unless I've missed the same page(s) every time. Also, I'm
sorry if this isn't the appropriate newsgroup.

thank you! - Tobbe
---
tobbe@gamma.me.chalmers.se (Gothenburg, Sweden, soon winter, argh!)

jrwsnsr@nmtsun.nmt.edu (Jonathan R. Watts) (10/30/89)

In article <73@me.chalmers.se>, tobbe@me.chalmers.se (Mu!) writes:
> Hello world,
> 
> I'm writing a program in TurboPascal v5 and have, since I'm a novice
> at the PC's memory limitations, encountered a problem (at least I think
> it could be a problem :-)). How do I know how much of the computers
> memory a program is going to use (no dynamic allocation), and how does
> one go about to test this? I'd like the program to do something like
> "if mem_avail > size_of(this_program) then begin(program) else error(message)"
> I have some ideas of how to do, but I don't know how to create the
> environment to test them in :-) I've read the manual, yes, but I found
> no hints there unless I've missed the same page(s) every time. Also, I'm
> sorry if this isn't the appropriate newsgroup.
> 
> thank you! - Tobbe

If you're not using the heap at all, you should use the $M compiler
directive to set the heap (maximum and minimum) memory to 0
(otherwise it will take up ALL available memory).

Other than that, the program should automatically give you an error message
if there isn't enough memory.

If this isn't what you meant, I apologize.

  - Jonathan Watts

jrwsnsr@jupiter.nmt.edu