Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could Rollbax cause a memory leak in my application? #120

Open
ryanzidago opened this issue Apr 29, 2021 · 4 comments
Open

Could Rollbax cause a memory leak in my application? #120

ryanzidago opened this issue Apr 29, 2021 · 4 comments

Comments

@ryanzidago
Copy link

Hi all,

I'm having some trouble identifying why do I have a memory leak in my application. You can find more info in this Elixir Forum post.
Otherwise, as a TLDR:

I have a process error_logger that keeps accumulating data. When I look into the process' state I see the following:

{items,{"Installed handlers",
        [{handler,'Elixir.Rollbax.Logger',false,
                  #{'__struct__' => 'Elixir.Rollbax.Logger',
                    reporters => ['Elixir.Rollbax.Reporter.Standard']},
                  false}]}}

This is why I think Rollbax may be causing memory leak in my application.

Elixir version:

1.11.2

Erlang version:

23.0.3

Rollbax version:

  "rollbax": {:hex, :rollbax, "0.11.0", "9557935d09d154c8775fa4efc709bfacbb73f20c58a3ced31dea2a74dd6e25de", [:mix], [{:hackney, "~> 1.1", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "a74318b175aae4bdddcc1ecfdf38755df3d8143c9902b1bfd19507ac9901062d"},

Do you know how does Rollbax uses the error_logger?
Does it seem plausible that Rollbax is causing a memory leak and if so, why? 🤔

@ryanzidago
Copy link
Author

After deactivating Rollbax from my app, the memory leak disapeared. So it seems that there is strong evidence that the memory leak is caused by Rollbax. This relates to what someone told me in my post.

However, I'd like to keep Rollbax around as all of our other applications use it without any trouble and Rollbar is quite convenient 😃

@qcam
Copy link
Contributor

qcam commented May 13, 2021

Hey @ryanzidago, I could help to take a look if you would be able to come up with a working repo to reproduce your observation.

@ryanzidago
Copy link
Author

Hey @ryanzidago, I could help to take a look if you would be able to come up with a working repo to reproduce your observation.

Thanks for offering your help 🙏
Unfortunately, I can't even reproduce the error on staging, let alone locally.

I was looking more fore an educated guess 😅

@ryanzidago
Copy link
Author

ryanzidago commented May 25, 2021

Disabling the enable_crash_reports "fixed" the issue because it didn't start the error_logger process.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants