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.

Local reference table overflow while adding markers in bulk #2726

Closed

Description

@tobrun

Documented at original ticket #2552
Stacktrace is located here

After resolving JNI issue:

  • add a Spinner to add 100, 1000 or 10000 markers (cfr. iOS)
  • add a progress indicator for AsyncTask

Activity

  1. added
    Android
    on Oct 22, 2015
  2. added this to the android-v2.2.0 milestone on Oct 22, 2015
  3. ljbade commented on Oct 22, 2015

    @ljbade
    Contributor

    @tobrun You need to call DeleteLocalRef on any objects that are created in a loop in the JNI.

    JNI only deletes "local refs" (ie Objects) at the exit of a JNI method, so if you generate a lot of objects before you return, you can overflow the local ref table.

  4. ljbade commented on Oct 22, 2015

    @ljbade
    Contributor

    In this case from the log, it is String and LatLng objects.

  5. self-assigned this
    on Oct 23, 2015
  6. ljbade commented on Oct 23, 2015

    @ljbade
    Contributor

    Deleting jid fixed the overflow.

    1,000 markers works:
    device-2015-10-23-154345

    10,000 markers freezes after it gets this far:
    device-2015-10-23-154345

  7. ljbade commented on Oct 23, 2015

    @ljbade
    Contributor

    Making a PR now.

    Still leaves:

    • add a Spinner to add 100, 1000 or 10000 markers (cfr. iOS)
    • add a progress indicator for AsyncTask
    • fix freeze with 10,000 markers
  8. added a commit that references this issue on Oct 23, 2015
  9. ljbade commented on Oct 23, 2015

    @ljbade
    Contributor

    @tobrun Can we also add an option to switch between addMarker() one at a time, and addMarkers() to stress test both ways.

  10. ljbade commented on Oct 23, 2015

    @ljbade
    Contributor

    Been investigating the 10,000 stall.

    I can repro with just 2,000 markers.

    Loading the GeoJSON into MarkerOption list takes 1.3 seconds.
    Adding the markers to the map with addMarkers takes 0.3 seconds.

    This happens in a async task so doesn't freeze the Android UI.

    What happens next is that the Core GL threads process the markers, and stalls renderSync, which in turn freezes the map.

    @kkaefer Is this a known problem in CoreGL?

    If we could solve the 30fps issue in Android then we could punt renderSync onto a separate Java thread and not freeze the rest of the app's UI while the map does it's thing. However this presents user location dot sync issues that I have not figure out yet.

  11. ljbade commented on Oct 23, 2015

    @ljbade
    Contributor

    @kkaefer by the way it only uses 1/8th of the CPU cores

  12. ljbade commented on Oct 23, 2015

    @ljbade
    Contributor

    Testing with 10k markers:

    device-2015-10-23-182045

    Loading the GeoJSON into MarkerOption list takes 1.3 seconds.
    Adding the markers to the map with addMarkers takes 0.7 seconds.

  13. ljbade commented on Oct 23, 2015

    @ljbade
    Contributor

    Testing with the maximum in the GeoJSON (27,267 markers):

    device-2015-10-23-183056

    Loading the GeoJSON into MarkerOption list takes 2.0 seconds.
    Adding the markers to the map with addMarkers takes 2.5 seconds.

  14. 6 remaining items

  15. assigned and unassigned on Oct 23, 2015
  16. ljbade commented on Oct 23, 2015

    @ljbade
    Contributor

    Ha-ha hmm

  17. added 4 commits that reference this issue on Nov 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Android

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions