in reply to Perl garbage collector and swap

It depends. Perl will 'free' values when there are no more references to them. That means Perl has to access to those values, possible 'free' associated structures, and even cascading the 'freeing' of variables. This could mean accessing recently accessed memory (for instance, a lexical variable in a small loop), which might be found in cache. It could also mean accessing 'old' values (for instances, modifying a long living object), which means Perl might have to access whatever is swapped out.

I expect this to be the case in almost any language that does garbabe collection. If you collect your garbage at one moment, and you have swapped, the act of collecting the garbage will cause a swap.

What's the lesson to be learned here? Don't swap. Invest in more memory.

Abigail