Skip to content

Navigation memory usage increases on subsequent navigations [iOS] #6890

@NickIliev

Description

@NickIliev

From @NL33 on February 5, 2019 23:7

Edit: Below I describe a bug that I assumed was an issue with the emulator. That might be the case, but alternatively could there be a navigation bug?

In my case, the emulator had been open a long time, and the pages where the issue appeared had experienced a lot of back and forth navigation. Is it possible that the navigation "fills up" (maybe the cache gets full), and this can lead to strange navigation behavior?

In my case, after many many (over a hundred) back and forths on the page, the navigation button just stopped working and the page would automatically navigate back to an earlier page (without any navigation being ordered). Maybe this was because of an over-used navigation?

If not, then it is probably an emulator bug as described below:


Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.1.1
  • Cross-platform modules: 5.1.1
  • Android Runtime: 5.1.0
  • iOS Runtime: 5.1.1

Describe the bug
I was running the emulator (ios, iPad) for approximately a day and half (ie, starting the emulator and not stopping it for a day and half; the computer was periodically asleep during the time, but the emulator was not shut down.). At that point, it started having faulty router navigation.

Specifically, (i) a navigation button would stop working and (ii) the emulator would navigate away from a certain page immediately upon going back to that page (even though navigation had not been ordered).

Navigation on the app is done with Router, Navigation Extras, and Active Router.

It is very unlikely this is a code error, because I have run the same code multiple times on different emulators (and on my device), without seeing this behavior.

I closed the emulator. On running it again, the behavior has stopped (and navigation is working properly).

So it seems likely to me that the navigation "glitch" was specific to the emulator, and probably a result of the emulator running for so long.

A breakdown in the emulator after running it for so long is not a significant concern. However, it would be helpful to know whether others have seen buggy behavior in an emulator open for a long time, as it would help me confirm whether or not there is some hidden code problem, a bug in router with Nativescript, or an issue with the iOS back button.

To Reproduce
I was running the emulator (using a webpack bundle), focusing on ipad. So I ran:
$ tns run ios --device "iPad Pro (12.9-inch) (2nd generation)" --bundle --env.development --env.uglify --env.aot

The emulator ran for about a day and a half (ie, 36 hrs+) before the behavior began. The computer was asleep periodically during the time, but the emulator was not closed.

Copied from original issue: NativeScript/nativescript-cli#4340


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions