Hi,
i have a problem with the AdvMemo. I try to use the memo as simple Terminallogging window.
Adding a few chars every second or so to the last line of the memo will result in massive memory consumption.
Simple test is a form with advmemo and a ttimer 200mSec.
Every "special" function of advmemo is off. No Autocompletion/autoexpand/autocorrect/undo/gutter or anything. Just plain memo, readonly with wordwrap = wwClientwidth.
Timer will do this:
===
procedure TForm1.Timer1Timer(Sender: TObject);
begin
AdvMemo1.BeginUpdate;
AdvMemo1.Lines[AdvMemo1.Lines.Count-1] := AdvMemo1.Lines[AdvMemo1.Lines.Count-1] + '[TEST]';
if AdvMemo1.Lines.Count > 10000 then
begin
while AdvMemo1.Lines.Count > 9000 do
begin
AdvMemo1.Lines.Delete(0);
end;
end;
AdvMemo1.EndUpdate;
AdvMemo1.RefreshMemo;
end;
< ="text/">p { margin-bottom: 0.21cm; }a:link { }
===
After half an hour program takes > 1GB RAM ! And if the "if Lines.count > 10000" happens and some lines are deleted the next Refreshmemo brings an ListIndex > max (-1) Exception ??? This will not happen if i switch off wordwrap before deleting the lines and switch on wordwrap after. But i do not understand this behavior.
Any hints particulary for the memory problem are welcome.
Gruß
Carsten