Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Upgrade apollo-cache-inmemory #4497

Merged
merged 1 commit into from
Dec 19, 2018
Merged

Upgrade apollo-cache-inmemory #4497

merged 1 commit into from
Dec 19, 2018

Conversation

brianlovin
Copy link
Contributor

Status

  • WIP
  • Ready for review
  • Needs testing

Deploy after merge (delete what needn't be deployed)

  • hyperion (frontend)

Ref apollographql/apollo-client#4210

Before this change, a memory leak problem in apollo-cache-inmemory would cause heap usage to rise continuously as optimistic updates were performed (e.g. anytime someone sent a message). Sending 20 messages quickly could cause the heap to go from 60mb memory usage to >1gb, and in many cases crash the browser. After updating to this alpha version of the package, I can see very clear garbage collection cycles with heap memory peaking at ~300mb.

Note: @mxstbr we still have some perf issues for people sending messages very quickly, but this is likely our application code and a result of many async events happening in our chat input. I hope #4472 will help with this :)

@brianlovin
Copy link
Contributor Author

If tests pass here @mxstbr I'm going to include this in our prod cut today.

@brianlovin brianlovin merged commit ce129dd into alpha Dec 19, 2018
@brianlovin brianlovin deleted the optimistic-update-mem-leak branch December 19, 2018 19:06
@benjamn
Copy link

benjamn commented Dec 19, 2018

Just a note that [email protected] has been published to npm, so no need for the -beta.0 suffix anymore: apollographql/apollo-client#4210 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants