Forum > Options

set memory size

(1/2) > >>

mikita:
I have many variebles, about 100.000 in array of single. How to set max. memory size in the Lazarus??

Marc:
Normally you don't need that, only if you want to declare it as local var, since it is created on the stack. AFAIK you can alter the stack size with the $M directive
Personally I wouldn't use that large arrays on stack. What you can do is to use a dynarray for it:
--- Code: ---var
  a: array of Single;
begin
  SetLength(a, 100000);
  ....
end;
--- End code ---

mikta:
Thank you Marc.  :)
Yes, it is local var. I make a technical calcul of digital terrain meassuring (many numbers and all need). I need set max stack size.

Marc:
If you use dyn arrays in that case, you have way more mem available. Stack is limited on most OSes

kao:
Hi, can you explain how to use a dyn array??

I´m kinda new on this.

Thanx

Navigation

[0] Message Index

[#] Next page

Go to full version