NodeOffersServiceFacade memory management #682
Replies: 2 comments 3 replies
-
|
yes I put substantial effort to improve this because the initial implementation for this was very poor in terms of memory and threading management Just a few clarifications for further analysis: Only selected market’s offers are kept in memory
The batching and lightweight pressure checks are there to prevent UI churn and allocation spikes when a channel has many offers. With “selected market only,” most of that complexity already targets just the visible list. There are useful comments though:
|
Beta Was this translation helpful? Give feedback.
-
|
I see number of offers always 0 at restarts and then it takes a while until its loaded. This is not expected as the offers are persisted in the local network DB and only at first start it takes a while to get all offers from the network. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I just saw the efforts for improving memory footprint in NodeOffersServiceFacade.
I think a better approach would be to just keep the offers in the facade for the selected market. We hardly can hide offers without causing confusion to the user, thus the max reduction is to only keep the number of offers per market. This should release enough the memory pressure if keeping all offers was causing issues. This would also reduce a lot of added complexity and delays.
If that is not enough we can inspect the models to see if we hold data not used or data which is redundant.
Please note that the data is anyway stored in the network layer and as long we avoid copying data but using references it does not add much to memory footprint.
Btw:
TRIM_MEMORY_COMPLETE,TRIM_MEMORY_MODERATE,TRIM_MEMORY_RUNNING_CRITICAL,TRIM_MEMORY_RUNNING_MODERATEandTRIM_MEMORY_RUNNING_LOWinComponentCallbacks2are deprecated (Apps are not notified of this level since API level 34). The only remaining areTRIM_MEMORY_BACKGROUNDandTRIM_MEMORY_UI_HIDDENwhich are not very useful for memory adjustment.Beta Was this translation helpful? Give feedback.
All reactions