ios - Keep incresing memory allocation -


in ios app implemented save videos web. keeps increasing memory usage when downloading videos. have inspect using profile in xcode , saw malloc getting increase per video. enter image description here

enter image description here not familiar profile stuff. have released receiveddata nsmutabledata variable.

- (void) connectiondidfinishloading:(nsurlconnection *)connection {    nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes);     nsstring *documentsdirectry = [paths objectatindex:0];    nslog(@"succeeded! received %d bytes of data",[receiveddata length]);    [uiapplication sharedapplication].networkactivityindicatorvisible = no;    nsstring *filename = [nsstring stringwithformat:(@"video_%@.mp4"),videourl];    [receiveddata writetofile:[documentsdirectry  stringbyappendingpathcomponent:filename ] atomically:yes];    receiveddata = nil;    [receiveddata release];    progress.hidden = yes; 

}

app getting down performance. how can fix issue.

you have not released receiveddata. have set variable nil before, message sent receiveddata goes nirvana.

also don't forget handle cases when connectiondidfinishloading never called, have release elsewhere because of this.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -