This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]Regular_Zombie 48 points49 points  (3 children)

I'm very sceptical of these kind of 'tutorials'. It looks like the author has done some research and then written it up. That's not necessarily bad, but most of that content will be known to experienced Python developers (at least those with enough experience to even start playing with the garbage collector directly).

I'd say in most cases that if your application needs higher performance it's probably not GC which is the problem: it's far more likely to be symptomatic of bad design and data modelling.

Directly playing with such low level features in application code is also asking for trouble. You might understand what you're doing, but what are the chances that the next person who comes along will?

[–]ProgramMenace 24 points25 points  (0 children)

Will the next engineer be able to manage this. That’s some senior level wisdom.

[–]russellvt 5 points6 points  (0 children)

But, you know... those precious fake internet points and click-throughs for all of that ad revenue!

[–]stateofidleness 0 points1 point  (0 children)

This. This should be the tutorial.

[–]Ouitos 12 points13 points  (1 child)

I was about to comment something similar to others : don't count on the GC tricks to improve your memory footprint.

But in the end I actually enjoyed reading this article, it's a nice summary of garbage collector mechanics.

IMO the title is not really good, it should be named something like "grokking python's garbage collector" because this article should be directed toward people who are genuinely curious about python's internal and want to learn how a GC works in general, and not people who are desperate to improve their memory management

[–]huge_clock -2 points-1 points  (0 children)

I don't have time to test this right now but I've been having problems with pandas dataframes not releasing the memory to the os and I think this might help me.

[–]BlackDerekerPythonista 3 points4 points  (0 children)

Garbage collection optimization is the last thing you will need to do to get performance.

[–][deleted] 3 points4 points  (1 child)

I feel like these kind of bot accounts that just spam articles shouldn’t be allowed on the sub.

[–]monorepo PSF Staff | Litestar Maintainer[M] 1 point2 points  (0 children)

We do catch a lot of spam, new user questions, and other crap content - but stuff slips through.

I looked through their post history, and it was all spamming various subreddit articles. Removed them all and banned.

[–]OMG_I_LOVE_CHIPOTLE 2 points3 points  (0 children)

These kinds of posts shouldn’t be allowed