Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: beginer question: multiple do the same procedure in file

From: moliad:aei:ca at: 4-Aug-2004 1:22

this depends on the actuall content of the file. in rebol, there is automatic garbage collection... so if the file is only defining words like in the following: ;------------------------------------ a: [a block of data] b: "a simple string" c: func [arg] [print arg] ;---------------------------------- everytime the file is 'DOne it will assign the new block, string and func to words which already exist. the data which was assigned to those words before , being unreferenced, will be added to the garbage heap. The memory should cleanup by itself, everytime it hits the threshold... which I have found to be something flexible, depending on what kind of data is collected. the following is an example of file content which will cause ram to fill up: ;--------------------------------------------------- either value? 'blk [ append/only blk ["a string"] ][ blk: [] ] probe blk ;---------------------------------------------- what happens here is that the same word is being reused so that blk is always being grown at each evaluation of the script... because you are actually adding data to a word which stays defined, no garbage collection is obviously possible, cause the data is referenced at least once... within blk... HTH -MAx