GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DEVEL::GLADIATOR (3)

.ds Aq ’

NAME

Devel::Gladiator - Walk Perl’s arena

CONTENTS

VERSION

version 0.07

SYNOPSIS



  use Devel::Gladiator qw(walk_arena arena_ref_counts arena_table);

  my $all = walk_arena();

  foreach my $sv ( @$all ) {
      warn "live object: $sv\n";
  }

  warn arena_table(); # prints counts keyed by class

  # how to spot new entries in the arena after running some code
  my %dump1 = map { ("$_" => $_) } walk_arena();
  # do something
  my %dump2 = map { $dump1{$_} ? () : ("$_" => $_) } walk_arena();
  use Devel::Peek; Dump \%dump2;



DESCRIPTION

Devel::Gladiator iterates Perl’s internal memory structures and can be used to enumerate all the currently live SVs.

This can be used to hunt leaks and to profile memory usage.

EXPORTS

    walk_arena

Returns an array reference containing all the live SVs. Note that this will include a reference back to itself, so you should manually clear this array (via @$arena = ()) when you are done with it, if you don’t want to create a memory leak.

    arena_ref_counts

Returns a hash keyed by class and reftype of all the live SVs.

This is a convenient way to find out how many objects of a given class exist at a certain point.

    arena_table

Formats a string table based on arena_ref_counts suitable for printing.

LIMITATIONS

This code may not work on perls 5.6.x and 5.8.x if PadWalker is installed. (Patches gratefully accepted!)

SEE ALSO

Become a hero plumber <http://blog.woobling.org/2009/05/become-hero-plumber.html> Test::Memory::Cycle Devel::Cycle Devel::Refcount Devel::Leak Data::Structure::Util

AUTHOR

Artur Bergman <sky@apple.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2006 by Artur Bergman.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

CONTRIBUTORS

o Karen Etheridge <ether@cpan.org>
o XXXX XXXXX (Yuval Kogman) <nothingmuch@woobling.org>
o Jesse Luehrs <doy@tozt.net>
o Brad Fitzpatrick <brad@danga.com>
o Ed J <mohawk2@users.noreply.github.com>
o Curtis Brandt <curtisjbrandt@gmail.com>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DEVEL::GLADIATOR (3) 2014-10-19

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.