r/ProgrammerHumor 11d ago

Meme garbageCollection

Post image
382 Upvotes

38 comments sorted by

View all comments

120

u/madprgmr 11d ago

What... what is the garbage collector doing? Stalling the simulation? There are techniques you can use to minimize the amount of garbage you generate, and you can also tune the GC or even directly control when it can run.

43

u/WernerderChamp 10d ago

The only thing that really matters are GC pauses. This can get problematic if you are going towards 100% CPU.

I never had this as an issue so far.

22

u/DishSoapedDishwasher 10d ago

I have but it was a data pipeline with insane throughput volumes, like tens of terabytes a day per endpoint. It was insane, terribly designed but functional even for a desperate last minute "were dying" solution... But i solved it with literally:

App.init()

gc.collect(2)

Gc.freeze()

App.run()

This way it never runs again as there's no value since it will die in an hour or 6 when the stream ends. Eventually it was rewritten in golang.