Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Zoomlevel 0, not becoming idle #6667

Closed
Closed

Description

@tobrun

When looking into the Android CI tests being flaky in #6546. I was able to pinpoint that a map at zoomlevel 0 keeps using CPU resources and allocating memory while it should be in an idle state (as it is with other zoomlevels).

Analysis

App startup, not showing a map:
screen shot 2016-10-12 at 09 53 07

Open screen with a map at zoom 0:
screen shot 2016-10-12 at 10 02 05

Double tap the map to go to zoom 1:
screen shot 2016-10-12 at 10 06 32 1

Impact on CI Espresso tests

The Android espresso testing framework is smart enough to wait until the app under test becomes idle (waits for message qeue to be empty and threads to halt). When the test app is idle, it will check if our map has been correctly loaded and notifies that the tests can run.

I noticed that tests showing zoomlevel 0, never start. It seems the app never returns to an idle state. When this occurs, the application stays open for 45 seconds until it espresso times out. Strange behaviour here is if I double tap while the application is timing out the tests will run.

Activity

  1. added
    Core
    on Oct 12, 2016
  2. tobrun commented on Oct 12, 2016

    @tobrun
    MemberAuthor

    Tried looking into what is happening that keeps the CPU active using a 10 second trace:

    screen shot 2016-10-12 at 13 37 20

    When you zoom into one spike:

    screen shot 2016-10-12 at 13 37 40

    You can see the following pattern: MessageQueue.next(), a couple of intermediate methods that results into the actual View.draw call. I normal cases we shouldn't be able to see anything here, for example here is a trace at zoom 1 for 10 seconds:

    screen shot 2016-10-12 at 13 44 21

  3. tobrun commented on Oct 18, 2016

    @tobrun
    MemberAuthor

    Been adding some log statements to the core code to see what is triggering the invalidations and noticed that the following in Map::Impl::render is called constantly:

        } else if (painter->needsAnimation()) {
            updateFlags |= Update::Repaint;
            asyncUpdate.send();
        }

    When starting a map not from default position, this is only called once.

  4. tobrun commented on Oct 19, 2016

    @tobrun
    MemberAuthor

    Proposed solution in #6747

  5. kkaefer commented on Nov 10, 2016

    @kkaefer
    Member

    Fixed in #6979

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions