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
Devel::Leak::Object(3) User Contributed Perl Documentation Devel::Leak::Object(3)

Devel::Leak::Object - Detect leaks of objects

version 1.02

  # Track a single object
  use Devel::Leak::Object;
  my $obj = Foo::Bar->new;
  Devel::Leak::Object::track($obj);

  # Track every object
  use Devel::Leak::Object qw{ GLOBAL_bless };

  # Track every object including where they're created
  use Devel::Leak::Object qw{ GLOBAL_bless };
  $Devel::Leak::Object::TRACKSOURCELINES = 1;

This module provides tracking of objects, for the purpose of detecting memory leaks due to circular references or inappropriate caching schemes.

Object tracking can be enabled on a per object basis. Any objects thus tracked are remembered until DESTROYed; details of any objects left are printed out to STDERR at END-time.

  use Devel::Leak::Object qw(GLOBAL_bless);

This form overloads bless to track construction and destruction of all objects. As an alternative, by importing bless, you can just track the objects of the caller code that is doing the use.

If you use GLOBAL_bless to overload the bless function, please note that it will ONLY apply to bless for modules loaded AFTER Devel::Leak::Object has enabled the hook.

Any modules already loaded will have already bound to CORE::bless and will not be impacted.

Setting the global variable $Devel::Leak::Object::TRACKSOURCELINES makes the report at the end include where (filename and line number) each leaked object originates (or where call to the ::new is made).

Devel::Leak

Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Devel-Leak-Object> (or bug-Devel-Leak-Object@rt.cpan.org <mailto:bug-Devel-Leak-Object@rt.cpan.org>).

Adam Kennedy, <adamk@cpan.org>

  • Karen Etheridge <ether@cpan.org>
  • Sven Dowideit <sdowideit@cpan.org>
  • David Cantrell <david@cantrell.org.uk>

This software is copyright (c) 2004 by Adam Kennedy.

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

Rewritten from original copyright 2004 Ivor Williams.

Some documentation also copyright 2004 Ivor Williams.

2020-01-11 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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