in reply to Is there a way to invoke perl's garbage collector?
Perl uses reference counting, not garbage collection. Everything is freed as soon as there is no reference to it.
Any memory freed by Perl might not be returned to the OS, but it will become available to Perl for reuse.
Update: For example,
print("Check size of process $$ and press ENTER."); # 1676K <STDIN>; $a .= ' ' for 1..100_000; print("Check size of process $$ and press ENTER."); # 1920K <STDIN>; undef $a; $a .= '!' for 1..100_000; print("Check size of process $$ and press ENTER."); # 1920K <STDIN>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is there a way to invoke perl's garbage collector?
by Anonymous Monk on Mar 07, 2006 at 20:43 UTC | |
by diotalevi (Canon) on Mar 07, 2006 at 22:09 UTC | |
by Anonymous Monk on Mar 07, 2006 at 22:51 UTC |