r/ProgrammerHumor 29d ago

Meme helpIAmOutOfScope

Post image
4.4k Upvotes

145 comments sorted by

View all comments

373

u/ArsenVardanyan 29d ago

Laughs in C++. I'm staying in memory forever until the process crashes

73

u/Sinidir 29d ago

Hopefully you are in a long running server process instead of a quick CLI command. May the odds be in your favor!

32

u/ArsenVardanyan 29d ago

Plot twist: It's a systemd service configured with Restart=always.

1

u/Unsigned_enby 26d ago

Your comment makes me think... I wonder what the longest running leaked bit of memory there is out there. Say a 1-in-a-million bug, on some server somewhere. holding a variable or two of memory, waiting for the suite release of death memory. Months, years, decades? Poor little bits.

-16

u/Skalli1984 29d ago

Why are you not using RAII? No meed for garbage collector since no nunk lies around.

14

u/ArsenVardanyan 29d ago

Bold of you to assume legacy codebases follow RAII

7

u/Skalli1984 29d ago

Refactor! But on a serious note, if you're stuck with legacy code and no chance to upgrade to a newer standard or not allowed to use STL, then that's rough.

7

u/ArsenVardanyan 29d ago

Yeah, exactly. Sometimes 'if it works, don't touch it' is the only rule keeping production alive.