in reply to Re^3: memory not freed after perl exits. Solaris.
in thread memory not freed after perl exits. Solaris.

Probably because your OS is setup such that each process can only address a maximum of 2GB. This is the normal configuration for 32-bit OSs.

And when you do: $x = 'x' x 2**30; It first requests enough memory (1GB) to build the string in. It then requests another 1GB (for $X) to copy the string into. (Dumb, but that's the way it works!)

As the perl executable is already consuming a few MB from startup, aftr you've allocated the first 1GB, there is not enough virtual memory left in the process to make the copy, so it fails.

I was using a 64-bit OS which means each process can access much more memory.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy