An open API service indexing awesome lists of open source software.

https://github.com/ku1ik/ecto-preload-bug

Example project for demonstrating Ecto preload bug
https://github.com/ku1ik/ecto-preload-bug

Last synced: 3 months ago
JSON representation

Example project for demonstrating Ecto preload bug

Awesome Lists containing this project

README

        

To reprodue the bug:

1. `git clone [email protected]:sickill/ecto-preload-bug.git`
2. `cd ecto-preload-bug`
3. `mix do deps.get, ecto.create, ecto.migrate`
4. `iex -S mix`

In iex run following commands:

5. `:observer.start`, switch to "Load Charts" tab
6. `PreloadBug.once` - this preloads once, no memory spike should be observed
7. `PreloadBug.twice` - this runs the same preload on alrady preload schema - observe huge memory spike, ~1 GB in this example project. In the project I discovered it we see 3-5 GB spike.
8. `PreloadBug.twice_not_in_parallel` - same as above but explicitly disable parallel loading - no memory spike!