Note that there are some explanatory texts on larger screens.

plurals
  1. POgSOAP C++ client memory leak
    primarykey
    data
    text
    <p>I have read the gSOAP docs and seen mentions of the fact that one should call soap_destroy(soap) and soap_end(soap) etc., however they are always examples with a single invocation on the service object. The service I am using returns about 40KB of text with each invocation. My problem is that memory usage grows linearly by about the same size for every request. I added soap_destroy(service->soap) within getWords to no avail. Can anyone indicate what cleanup code is missing from this code snippet? The requesting program should be running for days on end, so per request cleanup is what I am worried about rather than at shutdown.</p> <p>I have posted below an analagous example (sans error checking) based on <a href="http://www.webservicex.net/WCF/ServiceDetails.aspx?SID=43" rel="nofollow noreferrer">http://www.webservicex.net/WCF/ServiceDetails.aspx?SID=43</a>, (it returns chunks of text right?). Any help is greatly appreciated!</p> <pre><code>#include "soapBibleWebserviceSoapProxy.h" #include "BibleWebserviceSoap.nsmap" #include &lt;iostream&gt; extern "C" { #include &lt;unistd.h&gt; } struct Service { BibleWebserviceSoap service; std::string getWords(std::string &amp;title, int chapter) { _ns1__GetBibleWordsByBookTitleAndChapter req; _ns1__GetBibleWordsByBookTitleAndChapterResponse resp; req.BookTitle = &amp;title; req.chapter = 1; service.__ns2__GetBibleWordsByBookTitleAndChapter(&amp;req, &amp;resp); return *(resp.GetBibleWordsByBookTitleAndChapterResult); } }; int main(int argc, char* argv[]) { Service s; std::string genesis("Genesis"); for (int i=0; i&lt;360; ++i) { sleep(2); std::cout &lt;&lt; s.getWords(genesis,1) &lt;&lt; std::endl; } return 0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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