@@ -257,9 +259,9 @@ One of the reasons of the increased memory footprint could be Ruby memory fragme
...
@@ -257,9 +259,9 @@ One of the reasons of the increased memory footprint could be Ruby memory fragme
To diagnose it, you can visualize Ruby heap as described in [this post by Aaron Patterson](https://tenderlovemaking.com/2017/09/27/visualizing-your-ruby-heap.html).
To diagnose it, you can visualize Ruby heap as described in [this post by Aaron Patterson](https://tenderlovemaking.com/2017/09/27/visualizing-your-ruby-heap.html).
To start, you want to dump the heap of the process you are investigating to a JSON file.
To start, you want to dump the heap of the process you're investigating to a JSON file.
You need to run the command inside the process you are exploring, you may do that with `rbtrace`.
You need to run the command inside the process you're exploring, you may do that with `rbtrace`.
`rbtrace` is already present in GitLab `Gemfile`, you just need to require it.
`rbtrace` is already present in GitLab `Gemfile`, you just need to require it.
It could be achieved running webserver or Sidekiq with the environment variable set to `ENABLE_RBTRACE=1`.
It could be achieved running webserver or Sidekiq with the environment variable set to `ENABLE_RBTRACE=1`.
...
@@ -274,7 +276,7 @@ Having the JSON, you finally could render a picture using the script [provided b
...
@@ -274,7 +276,7 @@ Having the JSON, you finally could render a picture using the script [provided b
```shell
```shell
ruby heapviz.rb heap.json
ruby heapviz.rb heap.json
```
```
Fragmented Ruby heap snapshot could look like this:
Fragmented Ruby heap snapshot could look like this: