<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 21-Aug-2012, at 12:52 AM, Thiago Macieira wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">How? Putting up an alert usually requires allocating memory somewhere, be it<span class="Apple-converted-space"> </span><br>in your application or in the display server.<br></span></blockquote></div><div><blockquote type="cite"><br>If we're already out of memory, the likelihood of another set of allocations <br>succeeding is quite low. </blockquote><br></div><div>If a large allocation just failed, it's actually likely that you still have a large enough block of memory left to put up an alert. That's our experience with a scientific application, at least. We don't usually fail from a billion tiny allocations, we fail on an allocation of hundreds of megabytes.</div><div><br></div><div>In the old days on Macintosh (our application has been shipping since 1989) you would pre-allocate a block of memory that could be released under low-memory conditions just in order to show this alert. There's nothing preventing an application from pre-making the Out of Memory alert at start-up if such conditions are likely. Which they actually aren't (see first paragraph).</div><div><br></div><div><blockquote type="cite">Not to mention that, by the time you do run out of <br>memory, the chances are that the system has been swapping hard for several <br>minutes. The user will have likely pressed the Reset button long ago.</blockquote><br></div><div>That's always possible. They call tech support about that, too. Even a 32-bit application benefits from running on a 64-bit machine with lots of physical memory. On Windows, you even get an extra GByte in your address space.</div><div><br></div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Geneva; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>-John Weeks</div></div></span></span>
</div>
<br></body></html>