Memory leaks in basic "Hello World" app...?


#1

Hello,

A user recently commented about memory usage during instrument profiling of an iOS app. I have noticed similar issues with my app. So I have created a screen recording of profiling the memory usage of the basic “Hello World” basic app. The app was not modified in any way. It was created using tns create hello-world with CLI 3.4.1.

I put up the video here. I put some comments under the video. Anyone would have an answer why there is such a high memory usage, and why are there so many leaks indicated even in the default app? Or am I just mis-interpreting something?

(Notice the initial indication of 6000+ leaks around 5 seconds! HUH!?)


#2

Hello @pentool,

As commented here: Memory Issue on Android and iOS - the Instrument panel may be misled by the way the NativeScript iOS runtime works. Native objects are immediately released in a vanilla iOS app as soon as you navigate back from a page. However, in a NativeScript iOS app objects are released when the JavaScript counterpart is garbage collected. This behaviour can cause the Xcode instrument panel to falsely report memory leaks. Does your app crash eventually? This might be an indicator for a memory leak.


#3

Thanks for the feedback @deyan! I don’t know whether the app would eventually crash for I have not played with it that long.

I was looking at the demo app (screenshot enclosed). Memory seemed to be going up even if you don’t tap on the button itself, but just tapping the empty area of the app. However, if GC eventually will take of this, then I’m not worried.