I have a SOAP server running inside a Win32 Daemon. The functions are served over HTTPS. Im finding that calling only the 'new' function in my module (via SOAP) is resulting in a memory loss (as observed by watching the win32 task list).
Here's my SOAP 'wrapper':
my $hHTTP; my $hDaemon = HTTP::Daemon::SSL->new(LocalPort => 8001, SSL_key_file => $curDir . "/certs/server-key.pem", SSL_cert_file => $curDir . "/certs/server-cert.pem" ) || die "Can't start SSH Daemon. $!\n"; my $soap = SOAP::Transport::HTTP::Server -> new ( ) -> dispatch_to(qw(auth)); while ($hHTTP = $hDaemon->accept) { while (my $request = $hHTTP->get_request) { my $req = $request->{_headers}{soapaction}; $soap->request($request); $soap->handle(); my $response = $soap->response(); $hHTTP->send_response($response); } $hHTTP->close(); }
In my test app I call the function as follows:
use SOAP::Lite +autodispatch => proxy => 'https://testbed.org:8001/', on_fault => \&handle_fault; my $obj = auth->new();
I've wrapped this file in a test.pl that exec's it, waits 3 seconds and repeats. Here's the 'new' function that gets called inside the SOAP service:
sub new { my $pkg = shift; my $self = {}; bless ($self, $pkg); return $self; }
All I can figure (at this point) (based on my limited understanding of Perl) is that SOAP or HTTP are keeping the pointers to the instances of my class and not letting them go. Im wondering if there is some way to coax the refcount of my package so it can be freed / GC'd.

In reply to Leaking memory from SOAP service by ethrbunny

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.