-
Notifications
You must be signed in to change notification settings - Fork 202
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
Crash in AtomicDictionary "Error _ContiguousArrayBuffer.init - EXC_BREAKPOINT (SIGTRAP) Could not allocate memory" #3407
Comments
Thanks for opening this @fzy-spyro |
@atierian Here's the full crash log:
|
Hi @fzy-spyro, it appears to be happening during DataStore's reconciliation process. Do you have more details such as
|
Hey @lawmicha Please find responses below:
yes. Given this is proprietary project I have renamed table names and properties names. Plesee see attached schema file. It's rather "simple" schema. Its collection of tables where we mostly store pairs of timestaps and values. We do not have any relations set up etc
Some tables hold only 1 data row per user in dynamo but for some tables they can hold more than 10k rows (without real max number). Data for those tables are coming from external IoT sensores hence the big amout of rows.
Sync expressions are configured depending of fact if we expect lot of data to be stored in particular table - in such case we try to limit amout of data that is synced at first to only sync last x days of data and then we re-evaluate experssions at runtme to fetch remaining data:
other tables simply use :
We have quite low user base for now (~10-15) and following crash happend for ~20%. looking at device breakdown it happened mostly on iPhone XR, iPhone SE running iOS 17.
unfortuantely I do not have such logs to confirm it. If anything changes I'll update you with logs. |
Thanks for the info @fzy-spyro, are you able to capture any data related to the memory usage? With your dataset, are you able to check the memory usage during
Are you able to implement any low on memory notifications and correlate that with the crash instances? |
I tried to create a repro using your schema, and populating about 10k items in Table1, Table2, Table3, and 1000 in the rest (except for I think one or two tables that were using the userId as primary key). I was testing the memory usage around syncing down 35k+ items and it appears to operate fine. It spikes up to around 100MB in memory when the data is pulled into DataStore, and reconciles them into the local database. Each reconciliation operation operates on about 1k items at a time, which takes about 2-3s, so syncing everything (my dataset of 35k items) took approx 2mins. Could it be possible that the app has been running for some time, and another process has a memory leak leading to up to this crash? |
Yes, it is possible that app has been running for some time either in foreground or background. We were not yet able to reproduce this issue on our test devices unfortunately. As crash in the description happened on customer devices it will be quite hard for us to get the actual devices to run memory profiler. I will add more logging and low-mem events to see if this happens around start/stop calls etc and come back to you once we have more insights. |
@fzy-spyro, were you able to gather any more information regarding low-mem events? |
Describe the bug
We have observed a crash coming from Amplify SDK using Sentry
Steps To Reproduce
No steps to reproduce - caught by crash reporting tools
Expected behavior
No crash
Amplify Framework Version
2.22.0
Amplify Categories
API, DataStore, Storage
Dependency manager
Swift PM
Swift version
5.8
CLI version
12.2.3
Xcode version
Xcode 15.0.1 Build version 15A507
Relevant log output
Is this a regression?
No
Regression additional context
n/a
Platforms
iOS
OS Version
17.1.2
Device
iPhone XR
Specific to simulators
no
Additional context
No response
The text was updated successfully, but these errors were encountered: