The B::Size and B::TerseSize modules attempt to measure the size of Perl op codes. The output of B::TerseSize is similar to that of B::Terse, but includes the size of each OP in the tree and the PADLIST (subroutine lexical variables). The module can be run just as other compiler backends or used via Apache::Status (version 2.02 and higher). . http://perl.apache.org/docs/1.0/guide/performance.html#Measuring_the_Memory_Usage_of_Subroutines