NAME

Devel::MAT::Tool::Sizes - calculate sizes of SV structures

DESCRIPTION

This Devel::MAT tool calculates the sizes of the structures around SVs. The individual size of each individual SV is given by the size method, though in several cases SVs can be considered to be part of larger structures of a combined aggregate size. This tool calculates those sizes and adds them to the UI.

The structural size is calculated from the basic size of the SV, added to which for various types is:

ARRAY

Arrays add the basic size of every non-mortal element SV.

HASH

Hashes add the basic size of every non-mortal value SV.

CODE

Codes add the basic size of their padlist and constant value, and all their padnames, pads, constants and globrefs.

The owned size is calculated by starting at the given SV and accumulating the set of every strong outref whose refcount is 1. This is the set of all SVs the original directly owns.

Finds and prints the largest SVs by size. The 5 largest SVs are shown.

If counting sizes in a way that includes referred SVs, a tree is printed showing the 3 largest SVs within these, and of those the 2 largest referred SVs again. This should help identify large memory occupiers.

Takes the following named options:

--struct

Count SVs using the structural size.

--owned

Count SVs using the owned size.

By default, only the individual SV size is counted.

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>

Module Install Instructions

To install Devel::MAT::Tool::Sizes, simply copy and paste either of the commands in to your terminal

As a valued partner and proud supporter of MetaCPAN, StickerYou is
happy to offer a 10% discount on all Custom Stickers,
Business Labels, Roll Labels,
Vinyl Lettering or Custom Decals. StickerYou.com
is your one-stop shop to make your business stick.
Use code METACPAN10 at checkout to apply your discount.