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

Use a designated thread for GeoJSONSource features conversion - #14375

Closed
LukasPaczos wants to merge 1 commit into
masterfrom
lp-designated-gejson-conversion-thread
Closed

LukasPaczos wants to merge 1 commit into
masterfrom
lp-designated-gejson-conversion-thread

Conversation

@LukasPaczos

Copy link
Copy Markdown
Contributor

Refs #14048.

I've noticed, that constantly detaching and re-attaching threads to the JVM invokes GC. I don't quite understand why, but since we are allowing for only one async features conversion at a time and using a designated thread for the conversion removes a need of constantly attaching new threads from the pool, I think this is a beneficial change.

One downside here is, that now each GeoJSONSource instance creates and holds a new thread. A solution might be creating a fixed pool of long-lived threads that are permanently attached to the JVM, and not rotated. Any thoughts on this @ivovandongen?

@LukasPaczos LukasPaczos added the Android Mapbox Maps SDK for Android label Apr 9, 2019
@LukasPaczos LukasPaczos added this to the release-mojito milestone Apr 9, 2019
@LukasPaczos
LukasPaczos requested a review from ivovandongen April 9, 2019 12:35
@ivovandongen

Copy link
Copy Markdown
Contributor

@LukasPaczos Attaching a thread to the JVM indeed forces a sync with the GC (which may or may not require the GC to run).

Is it a possibility to handle the threading completely on the native side? And only communicate over the JNI boundary on the main UI thread? That way you could prevent re-attaching the thread all together without needing a thread-per-source setup.

@LukasPaczos

Copy link
Copy Markdown
Contributor Author

Closing in favor of #14450.

@LukasPaczos LukasPaczos removed this from the release-mojito milestone Apr 17, 2019
@LukasPaczos
LukasPaczos deleted the lp-designated-gejson-conversion-thread branch April 29, 2019 11:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Android Mapbox Maps SDK for Android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants