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.

hauleth

hauleth

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

Where Next?

Popular in Questions Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
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
hpopp
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
New

Other popular topics Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
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
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
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
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New

We're in Beta

About us Mission Statement