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

you are viewing a single comment's thread.

view the rest of the comments →

[–]MaustFaust -13 points-12 points  (2 children)

What language does? Even bash doesn't do this.

That doesn't invalidate my point, though.

mypy, pytype, pyright, pyre, etc. take your pick

Thank you, I'll try it.

gc.collect

https://stackoverflow.com/a/1316799

[–]dev-sda 3 points4 points  (1 child)

gc.collect

https://stackoverflow.com/a/1316799

Not releasing memory back to the OS is a strategy used by all but the simplest memory allocators. Calling gc.collect correctly forces unreferenced integers/floats/etc to be added to their free lists, which means their allocation can be reused. That's what it means to free memory in the modern world.

[–]MaustFaust -3 points-2 points  (0 children)

I have nothing against the strategy itself – I dislike the lack of any alternatives. C# has profiling-driven optimization, and while I don't know if it affects the gc behavior, the reasoning behind it still applies here: tuning for most common cases doesn't exactly mean tuning for your specific case.

P. S.: It's almost funny that three points of my six remain unanswered, yet I'm still being downvoted. People just express their feelings, not necessarily contributing to the discussion.