Hi Ladislav, Thank you for your precisions, as accurate as usual :-)
> > > This is a special case not handled by the Garbage Collector as you > correctly found out. The GC "thinks", that you are going to need this > allocated memory when you allocated it intentionally. Therefore, it will > not "shrink" the space. [[CC]] OK, I understand now >=20 > >After a few try-and-errors, I found that first using a 'make on the word > >previously to the call to 'recycle, solves the problem: > > > > > my-string: none >=20 > or >=20 > my-string: copy "" >=20 > or >=20 > unset 'my-string >=20 > would suffice. >=20 [[CC]] Actually, I did try those options, but without result, like illustrated (using /view 1.3): >> stats =3D=3D 4183470 >> my-string: make string! 10000000 =3D=3D "" >> stats =3D=3D 13186209 >> unset 'my-string >> recycle stats =3D=3D 13186113 ;-> not freed >> my-string: none =3D=3D none >> recycle stats =3D=3D 13186145 ;-> not freed >> my-string: copy "" =3D=3D "" >> recycle stats =3D=3D 13186161 ;-> not freed >> my-string: make none! none =3D=3D none >> recycle stats =3D=3D 3185810 ;-> freed But I did perhaps misunderstand some part of your explanation?=20 > > > Right. RECYCLE call was not totally necessary, because it would happen > automatically sooner or later anyway. >=20 > >You do not have to use a 'make none! To achieve this: a call to 'make > >string! "" or whatever does the job too. > The Garbage Collector is being called regularly anyway. If you call > RECYCLE too often, you are unnecessarily slowing down the interpreter. [[CC]] Indeed, as obviously shown here: >> rec: does [start: now/time/precise i: 0 loop 1000 [i: i + 1 recycle] print now/time/precise - start] >> rec 0:00:03.525 >> no-rec: does [start: now/time/precise i: 0 loop 1000 [i: i + 1] print now/time/precise - start] >> no-rec 0:00 >=20 > >You can find an interesting thread about this subject on the French > >REBOL forum: = http://www.codeur.org/forum/message.php?ID_Sujet=3D3D2500 > > > > > I tried the URL and I got a C++ related page? [[CC]] For some mysterious reasons (encoding perhaps?) some letters of my post are stripped out and replaced by weird things :-( (or is it Halloween approaching ?) The correct link is:=20 http://www.codeur.org/forum/message.php?ID_Sujet=3D2500 ending with "ID_Sujet equals 2500". > > > Yes, I think that those comments are helpful for somebody trying to > figure what is and what isn't collected by the GC. (Maybe we should put > it to a REBOL doc somewhere?) [[CC]] OK, I will try to synthesize this thread into an article on the REBOL Documentation Project :-)=20 =3D=3Dchristophe -- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.
