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 #36340 is a reply to message #36332] Mon, 21 May 2012 13:35 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
mdelfede wrote on Sun, 20 May 2012 14:20

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



Well, this has the problem that you do not really know how much memory is really available...
 
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: Fri May 29 23:51:26 GMT+2 2026

Total time taken to generate the page: 0.00510 seconds