ryanzidago

ryanzidago

Memory leaks caused by `:error_logger` process?

Hi all,

Heroku keeps killing the application because the memory quota is vastly exceeded (i.e. 220% of the quota is used). I’m trying to find the root cause of this. The application use the PhoenixLiveDashboard so I could inspect the processes using the most memory …

As you can see in the following picture, there is an :error_logger process that is using more than 1 GB of memory. Surely it isn’t normal right?

How can I find which piece of my code is responsible for spawning the :error_logger process and why is it accumulating so much data?

Could it be due to some Telemetry misconfiguration in the application?

I see here that Telemetry uses an error_logger module. Also I see that Elixir’ Logger uses this error_logger module by default here.

Thanks!

Most Liked

hauleth

hauleth

Seems like bug in Rollbax, not error_logger. Try to drop that library for test. If it help, then you have found culprit (it will probably also make error_logger process to go away). In general I prefer Sentry for error logging, so if you can switch, then it may be the interesting solution for you.

hauleth

hauleth

Both Elixir and Telemetry use error_logger only if you are using Erlang 20.x or earlier. In other situations it is not started unless there is other component that registers error_logger:add_report_handler/{1,2}.

If you are using OTP 20.x or earlier, then this process is started as part of kernel application and you cannot disable it (as this could cause you to lose information about processes that have failed).

ryanzidago

ryanzidago

Disabling the enable_crash_reportsfixed” the issue because it didn’t start the error_logger process.

error_logger is actually quite known to cause memory leaks :thinking: There’s a whole section about this process in the Erlang in Anger book.

If I have some free time, I’ll try to fork Rollbax and replace error_logger with either logger or lager, because I would still like to have those crash reports.

Last Post!

hauleth

hauleth

I highly suggest taking a look at Sentry. It always felt “cleaner” to me.

Where Next?

Popular in Questions Top

vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

We're in Beta

About us Mission Statement