U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » Out of memory panic
Re: Out of memory panic [message #36332 is a reply to message #36331] Sun, 20 May 2012 20:20 Go to previous messageGo to previous message
mdelfede is currently offline  mdelfede
Messages: 1310
Registered: September 2007
Ultimate Contributor
koldo wrote on Sun, 20 May 2012 20:15

Hello Massimo. You are in fact adding a OutOfMemoryHandler too. However I prefer the programmer and the user to use as much memory as it is available.


Well, if you trigger the memory callback when mem is completely exhausted, you won't be able to do anything when inside it... OTOH, if you estimate a "right" amount that triggers it, you'll be able to gracefully recover.
Anyways, you could do something like

::SetMemoryLimit(INFINITE, THISBACK(myHandler)); // No preset limit


you could also have the maximum available mem.

Max
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ...nize class
Next Topic: Value: String to int - problem or feature?
Goto Forum:
  


Current Time: Sat May 30 00:29:48 GMT+2 2026

Total time taken to generate the page: 0.00596 seconds