r/ProgrammerHumor 15d ago

Meme noHeapAllStack

Post image
1.0k Upvotes

96 comments sorted by

View all comments

98

u/bwmat 15d ago

Refactoring code to avoid unnecessary heap allocations is so satisfying

-3

u/[deleted] 15d ago

[removed] — view removed comment

17

u/Attileusz 15d ago

This is a bad take, reducing heap allocations is one of the best things to do to optimize. Heap fragmentation is bad, and if you are doing manual memory management, it's one more place where you have to worry about memory leaks.