Note that there are some explanatory texts on larger screens.

plurals
  1. POMemory leak with Perl's LWP using HTTPS
    primarykey
    data
    text
    <p>I think I found a memory leak with LWP when connecting via HTTPS. With the following script, memory usage increases constantly:</p> <pre><code>use LWP::UserAgent; $ua = LWP::UserAgent-&gt;new(); $request = HTTP::Request-&gt;new(GET=&gt;'https://www.google.com/'); while (1) { $response = $ua-&gt;request($request); sleep(1); } </code></pre> <p>This other script has no problems:</p> <pre><code>use LWP::UserAgent; $ua = LWP::UserAgent-&gt;new(); $request = HTTP::Request-&gt;new(GET=&gt;'http://www.google.com/'); # https =&gt; http while (1) { $response = $ua-&gt;request($request); sleep(1); } </code></pre> <p>Perl 5.12.3 / LWP 5.837 / Crypt::SSLeay 0.58 / Mac OS X 10.7.4</p> <p>Does anyone know a way around this?</p> <p><hr> <strong>UPDATE</strong></p> <p>Perl 5.12.4 / LWP 6.05 / Crypt::SSLeay 0.64 / Mac OS X 10.8.4</p> <p>The memory leak still exists when connecting through HTTPS. To try it out, run the sample script on the terminal, and see the memory grow and grow with the Activity Monitor.</p> <p><hr> <strong>UPDATE</strong></p> <p>After some testing I found out that, with the recent upgrade of my libraries, there is still a memory leak, but <strong>it only happens when you call certain addresses</strong> over HTTPS. In the above example I was calling <a href="https://www.google.com" rel="nofollow">https://www.google.com</a>, and it happens to be one of those addresses. For instance, this code gives me no memory leaks:</p> <pre><code>use LWP::UserAgent; $ua = LWP::UserAgent-&gt;new(); $request = HTTP::Request-&gt;new(GET=&gt;'https://twitter.com/'); # www.google.com =&gt; twitter.com while (1) { $response = $ua-&gt;request($request); sleep(1); } </code></pre> <p><hr> <strong>UPDATE</strong></p> <p>I reported the bug and some other people have confirmed my findings: <a href="https://rt.cpan.org/Ticket/Display.html?id=88287" rel="nofollow">https://rt.cpan.org/Ticket/Display.html?id=88287</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload