out of memory (27) error while calling curl_easy_perform met

Posted by adhyani on 13-Dec-2017 05:21

We are using libcurl.so.4 as an external library in our application and while performing the HTTPS call to the third party credit card sso using libcurl library methods we are getting out of memory (27) error in our webspeed logs. This issue is intermittent and occurring frequently during high load. While investigating I found this error is coming while calling  curl_easy_perform method in our curl.cls This method has been used as an external library method .

  PROCEDURE curl_easy_perform EXTERNAL "{&LIBCURL}" CDECL PERSISTENT:

      DEFINE INPUT PARAMETER ip-curl AS {&C_NULL_POINTER}.

      DEFINE RETURN PARAMETER ip-code AS {&C_ENUM}.

   END PROCEDURE.

Is their anyone who is using this external library and has faced the similar situation. Any help will be highly appreciated.

Thanks in Advance !!!

Thanks,

Ajay Dhyani,

All Replies

Posted by marian.edu on 13-Dec-2017 06:14

Since you’ve mentioned Webspeed you most probably have a memory leak issue somewhere, either ‘unmanaged’ objects in 4GL like memptr/sax/dom that you forget to clean-up (always do the clean-up in a ‘finally’ block) or the library API require some ‘dispose’ methods to be called when done. If those are left behind each time you make a HTTP call through the library it will continue to build up and eventually the webspeed agent will die with that out-off-memory error.




Marian Edu

Acorn IT 
+40 740 036 212

Posted by Peter Judge on 13-Dec-2017 08:07

There’s not a lot to go on how you’re using libcurl, but it’s very/most likely that you’re using memptrs. YOU need to be careful about managing the memory allocated too and by the external library; the curl doc is very good about telling you what it will manage and what it expects you to manage.
 
If you’re on a even remotely modern version, FINALLY and SET-SIZE() = 0 are your friend here.
 

This thread is closed