----boundary-LibPST-iamunique-2065258562_-_-
Content-type: text/plain
> -----Original Message-----
> From: Treutwein Bernhard
> [mailto:Bernhard.Treutwein{([at]})nowhere.xy> Sent: Saturday, 12 May 2007 12:07 AM
> To: info{([at]})nowhere.xy> Subject: RE: [BlackBox] - Memory leak bug report
>
>
> Hi Chris,
>
> are you really shure?
>
> > If you make an explicit call to Kernel.Collect in the loop
> > e.g. after the call to Sleep, then the memory of the unused
> > variables is successfully collected and the leak 'goes away'.
> >
>
> I tried that (without explicitely linking an app) and
> when you wait some minutes the non-responding BlackBox
> slowly increases the amount of allocated memory ...
>
I've learnt never to claim that I'm 100% sure ;-)
However, I tried it both ways - explicitly linking an app like the
original example and in the Blackbox Environment.
The only change I made to the original example which runs standalone was
the call to Kernel.Collect.
However, my version that runs in the Blackbox environment would be
different to yours. I also added code to process the message queue in
each iteration so that I could see the memory usage on Blackbox's status
bar (Windows Task Manager is not most reliable tool for measuring memory
usage). This could well explain the difference in behaviour. My version
is:
MODULE TestExe;
IMPORT Files, Stores, Kernel, Win := WinApi;
PROCEDURE ProcessMessages;
VAR msg: Win.MSG; res: INTEGER;
BEGIN
WHILE Win.PeekMessage(msg, 0, 0, 0, Win.PM_REMOVE) # 0 DO
res := Win.TranslateMessage(msg);
res := Win.DispatchMessageA(msg)
END
END ProcessMessages;
PROCEDURE Do;
VAR file: Files.File;
wr: Stores.Writer;
VAR
res: INTEGER;
BEGIN
file := Files.dir.New(Files.dir.This(""), FALSE);
wr.ConnectTo(file);
wr.WriteString ("Hello World!");
file.Register("tmp", "txt", FALSE, res)
END Do;
PROCEDURE Run*;
BEGIN
LOOP
Do;
Win.Sleep(50);
Kernel.Collect();
ProcessMessages();
END
END Run;
END TestExe.
Regards,
Chris
CFB Software
http://www.cfbsoftware.com/gpcp
----boundary-LibPST-iamunique-2065258562_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJ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