Files & Garbage Collector

From: [at]} <Gérard>
Date: Fri, 15 Oct 2004 23:33:08 +0200

----boundary-LibPST-iamunique-1216176281_-_-
Content-type: text/plain

Hello all,

I've just tumbled on an annoying problem concerning the deallocation of
Files.File. Apparently, when creating or opening large sets of files, GC
doesn't work as expected. For example, the following code will quickly blow
up your memory, although the same variable, f, is always use to store the
successive Files.File:

MODULE PrivMemOv;

 IMPORT

  Dialog, Files, Kernel, Strings;

 PROCEDURE Do*;

  VAR

   f: Files.File;
   s: ARRAY 12 OF CHAR;

  BEGIN (*Do*)
   LOOP
    f := Files.dir.Temp();
    Strings.IntToString(Kernel.Allocated(), s);
    Dialog.ShowStatus(s);
   END;
  END Do;

 END PrivMemOv.

Moreover, inserting Services.Colllect in the loop just slows down the code
dramatically, but doesn't cure the problem.
Hence my questions: Is it a bug? If not, it's a very annoying feature, since
it forbids any extensive management of files. How to do in these cases?

Gérard

--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.


----boundary-LibPST-iamunique-1216176281_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhc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dGVkIHRvIHRoaXMgZW1haWwgbGlzdCB0byB0
aGUgbGlzdCBvd25lciBhdFxwYXINCiAgIG93bmVyLWJsYWNrYm94QG9iZXJvbi5jaFxwYXINClxw
YXINCkN1cnJlbnQgcG9zdGluZyBwb2xpY3k6XHBhcg0KXHBhcg0KYSkgVG8gcG9zdCB5b3Ugc2hv
dWxkIHVzZSB0aGUgc2FtZSBhZGRyZXNzIGJ5IHdoaWNoIHlvdSBhcmUgc3Vic2NyaWJlZCB0byB0
aGUgbWFpbGluZyBsaXN0LiBUaGF0IHdheSwgdGhlIGxpc3Qgc2VydmVyIHdpbGwgcmVjb2duaXpl
IHlvdSBhcyBzdWJzY3JpYmVyIGFuZCBmb3J3YXJkIHlvdXIgcG9zdGluZyBpbW1lZGlhdGVseSwg
d2l0aG91dCBjcmVhdGluZyBhbnkgb3ZlcmhlYWQuXHBhcg0KXHBhcg0KYikgSWYsIGZvciBzb21l
IHJlYXNvbiwgeW91IGNhbm5vdCBwb3N0IGZyb20gdGhlIGFkZHJlc3MsIGJ5IHdoaWNoIHlvdSBh
cmUgc3Vic2NyaWJlZCwgeW91ciBtZXNzYWdlIHdpbGwgYmUgbW9kZXJhdGVkIHRvIGF2b2lkIHNw
YW0uIFBsZWFzZSB1bmRlcnN0YW5kIHRoYXQgbW9kZXJhdGlvbiB3aWxsIG9mdGVuIGNhdXNlIHNv
bWUgZGVsYXksIGluIHBhcnRpY3VsYXIgb3ZlciB3ZWVrZW5kcyBvciBob2x5ZGF5c319AGVlLmYo



----boundary-LibPST-iamunique-1216176281_-_---
Received on Fri Oct 15 2004 - 23:33:08 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:28:33 UTC