-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Store gfx::DrawScope objects with associated render objects. #15395
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall!
What is the best way to detect a situation like this in general? Is it possible to have a test that runs on CI which could catch a situation like this?
What is the reason not to do that now? Too much effort or is it blocked by something specific currently? |
I embarked on this refactor, but it got too convoluted in the symbol rendering code due to too many code paths, so I decided to split this into multiple PRs and address the issue separately. |
I've been using Instruments.app and Mark Generation, then manually inspecting the remaining allocations while running the I'm not sure there's a good way to automate this without lots of false positives in CI environment; I've been seeing various V8-internal allocations that I attributed to its memory management, as well as memory that was still allocated for good reasons (e.g. system caches of decompressed images). |
0a14006
to
2a688c3
Compare
Got it. Do you think we might avoid false positives if we had a pure C++ benchmark instead of using a node one (obviously would still have issue of system caches)? |
@kkaefer is this close to ready to merge? I'll leave it to @pozdnyakov or another @mapbox/gl-native dev to approve. |
bump @kkaefer |
I'm trying to figure out why https://circleci.com/gh/mapbox/mapbox-gl-native/317751 fails; it has repeatedly failed on CI at |
8ee9dd5
to
a8291fe
Compare
3c802fb
to
0d13778
Compare
We used some shared SegmentVectors, e.g. for drawing raster or background tiles. In longer running maps, this lead to resource accumulation. By storing the SegmentVectors and the contained gfx::DrawScope objects, we ensure that resources get released when the associated render objects vanish.
0d13778
to
ce9e0e0
Compare
Thanks for landing this @alexshalamov! |
We used some shared
SegmentVector
s, e.g. for drawing raster or background tiles. In longer running maps, this lead to resource accumulation. By storing theSegmentVector
s and the containedgfx::DrawScope
objects, we ensure that resources get released when the associated render objects vanish.As a longer term solution, we should remove
gfx::DrawScope
objects fromSegmentVector
objects and store them separately.Fixes: #15179