in reply to Module for memory allocation

Use Devel::Size module from CPAN.

This module is used to find the memory usage of Perl variables. Read about the functions size and total_size from that module.