Форум: "KOL";
Текущий архив: 2011.08.14;
Скачать: [xml.tar.bz2];
Вниз"memory hoarding" problem Найти похожие ветки
← →
jarek (2009-03-03 17:50) [0]Hi all,
I have problem with this code:program FormsTest;
uses
KOL;
type
PForm1 = ^TForm1;
TForm1 = object(TObj)
Form: PControl;
public
procedure FrmClick(Sender: PObj);
end;
var
Form1: PForm1;
procedure NewForm1(var Result: PForm1; AParent: PControl);
begin
New(Result,Create);
with Result^ do
begin
Form := NewForm(AParent,"Form1").SetSize(320,240);
Form.OnFormClick := FrmClick;
end;
end;
procedure TForm1.FrmClick(Sender: PObj);
var
NewForm: PForm1;
begin
NewForm1(NewForm,Applet);
NewForm.Form.Show;
NewForm.Free;
end;
begin
Applet := NewApplet("Forms Test");
NewForm1(Form1,Applet);
Run(Applet);
end.
Application takes after start 3108 kB of memory.
When I click on the form, new window opens and application takes more of memory. If I close this new window, the usage of RAM not changes.
If I open 100 new windows, application takes 3376 kB of RAM. If I close all new windows, application still takes 3376 kB of RAM.
Can anybody help me?
Thanks. jarek
← →
Дмитрий К © (2009-03-03 20:35) [1]in NewForm1
Form := NewForm( ...
Form.Add2AutoFree(Result);
← →
Jon © (2009-03-03 22:01) [2]Also make use of
SetProcessWorkingSetSize(GetCurrentProcess,Cardinal(-1),Cardinal(-1));
at convenient places, such as after freeing form.
Страницы: 1 вся ветка
Форум: "KOL";
Текущий архив: 2011.08.14;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.003 c