Just a small example of memory leak
#!/usr/bin/perl use strict; use Chart::Clicker; use Chart::Clicker::Context; use Chart::Clicker::Data::Range; use Chart::Clicker::Renderer::Bubble; use Chart::Clicker::Data::DataSet; use Chart::Clicker::Data::Series::Size; print "run 'top' in linux and look in perl process!\n"; my $j = 100000000; for (my $i =1;$i < $j;$i+=1){ print "$i iteration\n"; mysub($i); } sub mysub{ my ($var_i) = @_; my @k = (1,2,3); my $cc = Chart::Clicker->new(width => 800, height => 400 , format +=> 'png', padding => 10); my $series = Chart::Clicker::Data::Series::Size->new( keys => \@k, values => \@k, sizes => \@k, name => "$var_i", ); my $ds = Chart::Clicker::Data::DataSet->new( series => [ $series ] ); $cc->add_to_datasets($ds); my $defctx = $cc->get_context('default'); $defctx->renderer(Chart::Clicker::Renderer::Bubble->new); $cc->write_output($var_i); #undef $cc; print "\tmemory leak after 'cc->write_output'\n"; }
I can't find any solution and need quick help. I don't want to use any other perl chart lib. But I think I have no choice. :( With pleasure BorisPlus

In reply to Re^3: Out of memory using chart::clicker by BorisPlus
in thread Out of memory using chart::clicker by Peterpion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.