How does the garbage collector really works?

Bjorn Gustavsson <>
Wed May 17 11:10:05 CEST 2000


Ulf Wiger <> writes:

> In older versions of OTP (I think before R5B), you had to specifically
> call a function after calling garbage_collect(), for the GC to
> actually take place, but I'm pretty sure this has been fixed.

Actually, it is not fixed. You still have to call a function to force a
context switch.

I might fix it in R7, especially if you think it is important.

You can also call erlang:garbage_collect(Pid) from another process, which
will force an immediate garbage collection. (erlang:garbage_collect(self())
is equvivalent to erlang:garbage_collect().)

> 
> /Uffe
> 
> * Using a fibonacci sequence if I'm not mistaken.

Yes.

/Björn

-- 
Björn Gustavsson            Ericsson Utvecklings AB
      ÄT2/UAB/F/P
			    BOX 1505
+46 8 727 56 87 	    125 25 Älvsjö



More information about the erlang-questions mailing list