If you don&#x27;t have anything better to do, just abort().<p>One (naughty) option is to malloc a decent sized buffer at startup (50MB say), and then when malloc fails free it, and immediately display a warning box.<p>One most modern 64-bit systems, malloc will never fail anyway, you&#x27;ll get killed due to memory overcommit.