Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements when capture methods are called in tight loops #2379

Open
denrase opened this issue Oct 29, 2024 · 2 comments
Open

Improvements when capture methods are called in tight loops #2379

denrase opened this issue Oct 29, 2024 · 2 comments

Comments

@denrase
Copy link
Collaborator

denrase commented Oct 29, 2024

Problem Statement

Relates to #2371

When capturing in tight loops (awaiting the SDK methods), we run into memory issues (screenshot integration) on iOS and the watchdog might be killing the app. This probably happens because of screenshot widget, but there also might be other bottlenecks thought the SDK.

@buenaflor Still need to test this on an actual iOS device. In the meantime, can the user in question use something like exponential backoff until we come up with a solution? Think this PR here is good in itself, no need to do processing for dropped tasks, but it will not solve the issue of too many awaited tasks in a loop. Here we are still attaching screenshots.

Come to think of it, what if we cache the screenshot for some time? That way every event would still get a screenshot attached, but we could probably also relieve a bit of CPU/Memory pressure.

#2371 (comment)

Solution Brainstorm

  • Further investage where we have bottlenecks that can be improved.
  • Use a short-lived cashed screenshot to avoid making hundreds of screenshots if the SDK is called in a tight loop.

Are you willing to submit a PR?

Yes

@denrase
Copy link
Collaborator Author

denrase commented Nov 4, 2024

generally looks good, got one question

image

so these are not dropped since we await each call but according to the user this example can somewhat reproduce watchdog killing the app on ios.

can you reproduce this?

@buenaflor Just checked this again. The tasks are actually not awaiting on each other, so our code to handle is being called in this particular example. Woking on the cached screenshots now where i use a plain for loop, then the tasks are awaited.

@buenaflor buenaflor moved this from Needs Discussion to In Progress in Mobile & Cross Platform SDK Nov 7, 2024
@buenaflor
Copy link
Contributor

oh good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

2 participants