in reply to Garbage Collection and undef
Update: In Windows: (Numbers from Task Manager)
print("Press Enter to allocate a big chunk of memory."); <STDIN>; @a = (0..100000); print("Memory allocated.\n"); print("Press Enter to free it."); <STDIN>; undef @a; print("Memory freed.\n"); print("Press Enter to exit perl."); <STDIN>; __END__ 6,328K initially 8,332K after allocating 7,952K after freeing.
print("Press Enter to allocate a big chunk of memory."); <STDIN>; { my @a = (0..100000); $a[0] = $a[0]; print("Memory allocated.\n"); print("Press Enter to free it."); <STDIN>; } print("Memory freed.\n"); print("Press Enter to exit perl."); <STDIN>; __END__ 6,328K initially 6,728K after allocating 6,728K after freeing
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Garbage Collection and undef
by eyepopslikeamosquito (Archbishop) on Oct 17, 2004 at 08:19 UTC | |
|
Re^2: Garbage Collection and undef
by tilly (Archbishop) on Oct 17, 2004 at 06:59 UTC |