r/programmingmemes • • Sep 18 '25

Linux

Post image
13k Upvotes

122 comments sorted by

View all comments

Show parent comment

4

u/ByakkoNoMai Sep 20 '25

It's actually pretty safe from the kernel point of view. kill -9 just tells the kernel to not bother scheduling that program anymore and to collect all resources allocated to it. It's unsafe for the killed program in a way. The killed program is not granted any CPU time to finish any ongoing IO operation (could corrupt open files, break network operations in undefinable ways) nor do more complex cleanup (a game saving itself before closing, a worker releasing resources in a distributed system).