josemarluedke / glimmer-apollo

Ember and Glimmer integration for Apollo Client.
https://glimmer-apollo.com
MIT License
38 stars 14 forks source link

Memory leak? #51

Closed johanrd closed 8 months ago

johanrd commented 3 years ago

Steps to reproduce:

  1. Run the examples/glimmerx app with yarn start
  2. Open localhost:8080 in Safari and record a Memory and JavaScript Allocations timeline for a minute while navigating between http://localhost:8080 and http://localhost:8080/notes/add
  3. Experience that the size of memory grows steadily, while garbage collection (S) has next-to-no effect: Screen Shot 2021-10-26 at 19 21 24

Screenshot from Chrome:

Screen Shot 2021-10-26 at 19 43 43

I experience the same in my ember app when trying out glimmer-apollo (a lot more data leads to eventual crashes). Initially thought it was because I did some data fetching in controllers, but being able to reproduce with examples/glimmerx makes me question whether the hungry memory consumption is inherent to glimmer-apollo?

Or is the expected behavior that all results are retained in memory until a manual garbage collection of the InMemoryCache?

josemarluedke commented 3 years ago

I will have to take a deeper look but do keep in mind that Apollo does keep a cache of data in memory.