AlphaWallet / AlphaWallet/alpha-wallet-android

Completely decouple transactions fetch from TransactionViewModel (TVM)

Offen
#1,370 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
646
Forks
579
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Recently this was reported from crashlytics:

```
Caused by java.lang.OutOfMemoryError: Failed to allocate a 897920 byte allocation with 717464 free bytes and 700KB until OOM
at java.lang.StringBuilder.toString + 408(StringBuilder.java:408)
at org.json.JSONStringer.toString + 430(JSONStringer.java:430)
at org.json.JSONArray.toString + 586(JSONArray.java:586)
at com.alphawallet.app.service.TransactionsNetworkClient.lambda$fetchLastTransactions$0$TransactionsNetworkClient + 76(TransactionsNetworkClient.java:76)
at com.alphawallet.app.service.-$$Lambda$TransactionsNetworkClient$pI6X5v-wFy_e2wipNKXrQfnX1vs.call(lambda)
at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual + 44(SingleFromCallable.java:44)
at io.reactivex.Single.subscribe + 3603(Single.java:3603)
at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run + 89(SingleSubscribeOn.java:89)
at io.reactivex.Scheduler$DisposeTask.run + 578(Scheduler.java:578)
at io.reactivex.internal.schedulers.ScheduledRunnable.run + 66(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call + 57(ScheduledRunnable.java:57)
at java.util.concurrent.FutureTask.run + 237(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run + 272(ScheduledThreadPoolExecutor.java:272)
at java.util.concurrent.ThreadPoolExecutor.runWorker + 1133(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run + 607(ThreadPoolExecutor.java:607)
at java.lang.Thread.run + 762(Thread.java:762)
```

It implies that during a transaction fetch, the phone ran out of memory.

- [ ] Limit transaction fetch to 2000 tx per fetch. This is fine because the next tx fetch will resume from last block recorded.
- [ ] Write transactions straight to database during fetch. Simply return the TransactionMeta entries. Even these may not be needed; the entries could be generated on the fly.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.