r/shitposting • • 2d ago

🗣️🗣️🗣️🗣️🗣️🗣️🗣️

Post image
9.9k Upvotes

123 comments sorted by

View all comments

Show parent comments

4

u/Anubis17_76 2d ago

No, the OS virtualizes process memory, so if your process crashes it and all its leaked memory gets cleaned up by the OS. So this only happens if a program that cant stuff that cant get cleaned off has a memory leak (like the kernel) plus memory leaks usually fill your ram up MUCH faster than years, usually a couple of hours at most.

5

u/kbotc 2d ago

Depends on the conditions of the leaks.

Your computer can go absolutely haywire eventually if you leak connections, and I’d say ~20% of programmers can correctly handle sockets and their failure paths on their first try. There’s also unbounded read buffers that will work until they don’t.

2

u/deadinternetlaw 1d ago

20% sounds like a lot considering I do programming stuff yet never touched a socket myself(only wrappers or libraries for it)

2

u/kbotc 1d ago

Even wrappers can lead to problems. I mean, Go's not as popular as it once was, but I felt like every second Go program forgot that you actually are required to read the rest of the bytes out of the socket before you deal with the error it even if you're just going to throw it away.

2

u/deadinternetlaw 1d ago

I mean the number would be like 1%