I've got a method which uses swift's String(contentsOf: ...
function to pull data off a website asynchronously several times in a row. Using the SwiftSoup
library, I'm able to parse data from the HTML. This data is then stored into an array of struct
instances. The struct contains 3 Strings, 2 Ints, 1 Bool and 1 array of strings
It works great, but something what I've noticed is that whilst profiling my app's memory use, is that every time I call this method, persistent RAM usage increases by around 1.5MiB every time.
My question is, is this normal behavior? If not, how can I force my app to release unused variables or whatever to memory?
Do note that the peaks shown in the screenshot are from a different method which is called when changing to a different view controller, so they may be ignored.