in reply to Closures and lexical scope

On Linux you can check size by reading the /proc filesystem. See Apache::SizeLimit for sample code.