Hello,

I'm trying to found a memory problem with https request connections .

I test with this script :

===================================================
use strict;

use Memory::Usage;
use Mojo::UserAgent;

my ($ua,$res);
my $mu = Memory::Usage->new();

#
foreach my $i(1..10)
{
  print $i,"\n";
  $mu->record($i);

  foreach (1..10)
  {

    $ua  = Mojo::UserAgent->new;
    $res = $ua->get('https://www.wikipedia.org')->result;
    if    ($res->is_success)  { }
    elsif ($res->is_error)    { $res->message }
    elsif ($res->code == 301) { say $res->headers->location }
    else                      { say 'Other error' }
    ##
    sleep 1; # Be polite, do not DDOS wikipedia
  }
}
$mu->dump();
===================================================

And output is :

  time    vsz (  diff)    rss (  diff) shared (  diff)   code (  diff)  
 data (  diff)
     0  218976 ( 218976)  24784 ( 24784)   4072 (  4072)   1364 (  1364)  
20404 ( 20404) 1
    30  227720 (  8744)  30172 (  5388)   4900 (   828)   1364 (     0)  
25008 (  4604) 2
    58  227916 (   196)  30252 (    80)   4900 (     0)   1364 (     0)  
25204 (   196) 3
    87  228048 (   132)  30384 (   132)   4900 (     0)   1364 (     0)  
25336 (   132) 4
   115  228048 (     0)  30500 (   116)   4900 (     0)   1364 (     0)  
25336 (     0) 5
   143  228208 (   160)  30584 (    84)   4900 (     0)   1364 (     0)  
25496 (   160) 6
   171  228372 (   164)  30692 (   108)   4900 (     0)   1364 (     0)  
25660 (   164) 7
   199  228372 (     0)  30808 (   116)   4900 (     0)   1364 (     0)  
25660 (     0) 8
   227  228504 (   132)  30920 (   112)   4900 (     0)   1364 (     0)  
25792 (   132) 9
   260  228556 (    52)  30996 (    76)   4900 (     0)   1364 (     0)  
25844 (    52) 10

The data an rss is always growing ... 

How can check where is the problem  ? I read that IO::Socket::TLS in the 
past have memory leak problems ...

This is my mojo version output:

mojo version
CORE
  Perl        (v5.16.3, linux)
  Mojolicious (7.94, Doughnut)

OPTIONAL
  Cpanel::JSON::XS 4.04+  (n/a)
  EV 4.0+                 (n/a)
  IO::Socket::Socks 0.64+ (n/a)
  IO::Socket::SSL 2.009+  (2.059)
  Net::DNS::Native 0.15+  (n/a)
  Role::Tiny 2.000001+    (2.000005)


And OS is : 

CentOS Linux release 7.3.1611





-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to