On Tue, 25 Sep 2001, Frank Heckenbach wrote:
There is a known problem. Some operations (esp. string concatenation) need temporary storage (on the stack) which isn't freed immediately, so it will accumulate in loops. A trivial example follows.
program Foo;
var s: String (100) = '';
begin repeat s := s + '' until False end.
I think we know the cause of the problem (alloca_string if anyone cares) and therefore can fix it soon.
The only know work-around for know is to move the loop body into a subroutine. That's not nice, but if it works, you can at least be quite sure it's this problem you see.
That was part of my problem. If I modify my code in this style:
program Foo;
var s: String (100) = '';
procedure loop;
begin s := s + '' end;
begin repeat loop; until False end.
it is not growing that fast any more. (In fact, for this particular example it is not growing at all.) For that I had to move all the string operations behind a procedure (i.e. concat, writestr and readstr). However it is still growing a bit. Could that caused by the calls of the "random" function in the program?
Cheers,
miklos