question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RAM usage too high when persisting data

See original GitHub issue

We are having a difficult time with the app we are building to have offline capabilities.

The RAM usage is really high when the data is fetched and passed to the reducers (especially when it contains large JSON data), which crashes the app.

If we remove the redux-persist package, the RAM is fine but we need offline capabilities in our app that have large data transfer from API calls to mobile.

Anyone have any idea on what to do or how to flush the RAM out after each call?

“redux-persist”: “5.10.0”

Thanks.

configureStore.js

const persistConfig = { key: "root", storage: isApple() ? storage : FilesystemStorage, stateReconciler: autoMergeLevel2, };

const enhancer = compose( applyMiddleware(thunk), );

const pReducer = persistReducer(persistConfig, reducer); export const store = createStore(pReducer, enhancer); export const persistor = persistStore(store);

reducerIndex.js

const projectsPersistConfig = { key: "projects", storage: isApple() ? storage : FilesystemStorage, blacklist: ["selected", "isLoading", "selectedTile"] };

const setupPersistConfig = { key: "setup", storage: isApple() ? storage : FilesystemStorage, blacklist: ["connection", "isLoading", "authFailed"] };

const defectsPersistConfig = { key: "defects", storage: isApple() ? storage : FilesystemStorage, blacklist: ["syncError", "isLoading", "selected", "showToaster"] };

const rootReducer = combineReducers({ defects: persistReducer(defectsPersistConfig, ReducerDefects), setup: persistReducer(setupPersistConfig, ReducerSetup), projects: persistReducer(projectsPersistConfig, ReducerProjects), });

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:7

github_iconTop GitHub Comments

4reactions
varshilucommented, Jan 8, 2021

Removed redux persist completely from the project and started using SQLite react-native-sqlite-storage.

2reactions
walmatcommented, Nov 8, 2020

Has then been addressed at all? I’m experiencing the same issue and wonder if someone has found a fix for it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix High RAM Memory Usage Issue on Windows 11/10 [10 ...
High Memory Usage is a state where Windows computers' RAM, ROM, or Cache usage grows to an extremely high level. Windows 10 high...
Read more >
High Memory utilization and their root causes | Dynatrace
Increasing memory is the obvious workaround for memory leaks or badly written software. Let's discuss the two most common causes for Java high...
Read more >
What to Do When Your Data Is Too Big for Your Memory?
Time-costing solution: Your RAM might be too small to handle your data, but often, your hard drive is much larger than your RAM....
Read more >
Why is my RAM usage so high when nothing is running?
The data stored on the RAM is temporary and as you shut down your PC the memory usage turns to 0. However, when...
Read more >
How to Free Up RAM and Reduce RAM Usage on Windows
You should always install app updates in a timely manner for security reasons, but doing this can help you reduce RAM waste, too....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found