Toot

Written by sumanthvepa on 2024-12-03 at 11:26

Was writing C++ code that deals with very large files in memory. Sometimes the files in question are larger than physical memory. I wrote my C++ code to catch memory allocation failures and terminate gracefully,

But that is not what happens. On modern Unixes, the kernel's OOM (out-of-memory) process will kill a process to terminate it before the process itself gets a a chance to terminate gracefully.

How do folks deal with this?

https://stackoverflow.com/questions/58935003/detecting-that-a-child-process-was-killed-because-the-os-is-out-of-memory

#linux #macOS #cpp #cplusplus

=> More informations about this toot | View the thread | More toots from sumanthvepa@mastodon.social

Mentions

Tags

=> View linux tag | View macos tag | View cpp tag | View cplusplus tag

Proxy Information
Original URL
gemini://mastogem.picasoft.net/toot/113588646124271905
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
342.600112 milliseconds
Gemini-to-HTML Time
0.434806 milliseconds

This content has been proxied by September (3851b).