Most perl operators that return a value are allocated a private SV to hold their result. XS writers would know this as the TARG. In the case that five 'x' operators appear in the source, five SVs would be created. Each time that particular 'x' is executed, the corresponding SV has a million-byte string assigned to it. Perl does it this was because it's fast. If you put the whole thing in a loop and run it 100 times, it doesn't doesn't take up any more memory.
The other efrect is that at the end of scope, the underlying memory structures that implement lexical vars are not usually destroyed; instead they hang around on the assumption that next time round the loop a new lexical variable of similar type will have to be created. So it's a
speed/memory tradeoff.