-
Notifications
You must be signed in to change notification settings - Fork 283
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
OutOfMemory Error on devices under 2GB of RAM. #285
Comments
Good thing to check. Did you check the memory usage in AS? Also, the app is already 19MB which is in the middle of below. Once, running, who knows what happens. Still interesting how some other apps can get by with 3-5MB and essentially already doing all it is supposed to do, check/track for contacts. Is this project over-engineered?
@vitorpamplona |
Feel free to implement a version of the Storage that is not loading memory so much. The current version uses the commonly used react async storage which, if I am not mistaken, needs to load in memory. |
Not familiar with this type of storage. Seem a bit weird to abstract away simple SQLite into something that is anyway using SQLite3. But I found this:
|
It's not weird. It's just way simpler than SQLite. I think what you found refers to the disk space, not memory. Not sure what to do there. |
Let's just agree to disagree on that. I've had these SQL discussions for almost a decade, and yet, all DBs are still using SQL. Why? Simplicity and clarity.
LoL. Like I said above. If people actually bothered to understand SQL and SQLite3 in particular, you will quickly find that SQLite3 also has memory only implementation and the only relevant limitation is that what was put there by the abstraction layer. I believe that the new RockDB or whatever else they had, was to improve performance for non SSD devices. Anyway, why not just try with the change proposed above? |
Well, try and see if you can replicate the bug with and without the tag. I still don't understand how a lack of memory can be solved by allowing bigger memory limits. Btw, I have 25 years of SQL experience. In fact, I coded the business logic of an entire ERP in PLSQL, where stored procedures had 5k+ lines and selects with 34joins and sub-sub-sub queries were common. So, relax. I know what SQL is. |
Yes, I am sure you know your stuff. Please don't take my comments personal. But asking me to replicate something that you experienced, without any info at all how you got that message, is obviously asking the impossible. (From above) How do you even know it came from this app?? Anyway, it's in cases like this, it may be a good idea to implement a simple "debug screen" that the user can copy, to save elsewhere. That screen would contain some limited logcat messages coming from this app. |
This is not something I experienced, unfortunately. This comes from the PlayStore Console. The stack is everything it gives us. And happens every day on such devices. So, it seems to be a very common problem (easy to replicate on an emulator, where you can reduce OS memory until it breaks). It's a good practice to first replicate and find where and how it happens before suggesting solutions. And, of course, we can't merge anything without evidence that actually solves the problem. |
@vitorpamplona - do the logs give us anything more specific on the particular device? Make/model, etc? Wondering how we replicate to verify the fix. |
The list is quite big. Most of the budget phones are there. Since this is an OutOfMemory, it can happen on all phones, we just need to load enough info on the memory to trigger similar errors. Here are the top ones:
|
Any of the following should provide you with enough info to track down the problem.
|
The issue is in Overlap.js where you pull the public csv dataset from here: https://raw.githubusercontent.com/beoutbreakprepared/nCoV2019/master/latest_data/latestdata.csv This is over 50MB and is too much to be loading straight into memory. This needs to be buffered and stored somewhere without loading the entire csv into memory. This dataset is only going to get larger. |
For ref: Overlap.js Unless you have a smart way to parse CSV on-the-fly, I suggest loading it all into a DB and selecting only the data relevant for our location history. BTW. Where is our location history stored? Alternatively, not use that particular CSV at all, and instead ask maintainers to split file according to regions or something. PS & Heads up!
Here's another nice example line, only 900 chars long:
|
Let's see:
So someone need to be able to store at least : Clearly we can't do anything of what was just suggested, without being able to first selectively chose the data to be downloaded. We need to use some kind of tile method like most GPS map apps are using to download only data from tiles where user has been. |
@tstirrat Think we can close this one? I believe the work is in-progress on Jira to improve the overall app performance by reducing payload sizes from HAs. |
On or after my joining Safe Path on April 25, 2020, I brought up this same bottle neck. Where is data stored for the terra bytes involved? A NoSQL database that can store highly structured columnar data, key value, etc. is best long term and deploy a master contact tracing app that can scale up across state lines and countries. |
Not much to go on, but it might be the AsyncStorage with huge JSONs in memory.
java.lang.OutOfMemoryError:
at java.lang.StringFactory.newStringFromBytes (StringFactory.java:178)
at java.lang.StringFactory.newStringFromBytes (StringFactory.java:54)
at java.lang.StringFactory.newStringFromBytes (StringFactory.java:46)
at com.RNFetchBlob.RNFetchBlobFS.readFile (RNFetchBlobFS.java:225)
at com.RNFetchBlob.RNFetchBlob$6.run (RNFetchBlob.java:227)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
at java.lang.Thread.run (Thread.java:764)
The text was updated successfully, but these errors were encountered: