r/ProgrammerHumor 1d ago

Meme garbageCollection

Post image
300 Upvotes

33 comments sorted by

View all comments

112

u/madprgmr 1d 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.

36

u/WernerderChamp 23h 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.

16

u/DishSoapedDishwasher 22h 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.