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

How do show_growth deltas behave when memory runs out? #37

Open
rschwiebert opened this issue Apr 25, 2018 · 1 comment
Open

How do show_growth deltas behave when memory runs out? #37

rschwiebert opened this issue Apr 25, 2018 · 1 comment
Labels

Comments

@rschwiebert
Copy link

I'm profiling to find a leak in an API endpoint that runs a complex process. I have objgraph.show_growth report at two or three points inside the endpoint's main method.

Hitting the endpoint over and over, I quickly hit a MemoryError, and for a while large positive deltas are reported, but finally the deltas stop being reported at all.

I guess conceivably this could mean one of two things:

  1. There is no positive delta to report: memory is saturated with objects involved and no new ones are created.
  2. Objects are being created, but show_growth can't function properly in the given memory, so it doesn't report them.

I don't really understand this library well enough to see which one is more likley, but can you comment as to which one you think it is?

Thanks.

@mgedmin
Copy link
Owner

mgedmin commented Apr 25, 2018

Ooof. I've never dealt with a MemoryError, so I cannot say for sure. I would speculate that a MemoryError might mean some internal data structures get updated incompletely, which might cause the next show_growth() to report more new objects than there are actual new objects (assuming no more MemoryErrors occur).

You can always double-check by looking into how many objects are tracked by the Python garbage collector, by looking at len(gc.get_objects()) periodically.

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

No branches or pull requests

2 participants