i looking way around apparent memory leak in mac implementation of rest client. code generate memory leak following (running xe8, update 1):
program mac_rest_leak_test; {$apptype console} {$r *.res} uses system.sysutils, rest.client, rest.types, ippeerclient; var request : trestrequest; ii, imax : integer; begin imax := 1; ii := 0 imax begin request := trestrequest.create(nil); // fake online rest api testing , prototyping request.client := trestclient.create('http://jsonplaceholder.typicode.com/'); request.method := rmpost; request.execute(); request.client.free(); request.free(); end; end.
this smallest block of code demonstrates leak. essentially, have synching service makes rest requests every often.
when run on windows, using madexcept, no leaks found. examining running process in processmonitor shows no increase in amount of memory being used.
when run on mac, however, activity monitor shows memory allocated app continue rise. further, when run using instruments, there appear leaks dealing several url , http classes on mac.
does know how resolve leak?
(as aside, helpful know leak coming on mac, delphi classes listed tmethodimplementationintercept. i'm believe due fact delphi doesn't generate dsym file mac. if knows way around that, awesome too!)
update varying imax
1 10 , comparing fastmm4 output, appears leak in class macapi.objectivec.tconvobjid.xform
. 10 iteration output contains 9 more leaks stack trace compared 1 iteration. have reported embarcadero rsp-12242.
yes fastmm4 has osx leak reporting support in latest svn revision. unfortunatly, "global" leaks simple empty delphi fmx application makes difficult analyse mem-logfile. few leaks has been fixed in xe10 objects in macapi.objectivec bridge still generate leaks. have reported in quality central & quality portal (qc & qp). it's difficult use fastmm4 leak finding.
please separate delphi object leaks , objectivec leaks, second can find instruments.
Comments
Post a Comment