Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Out of memory panic
Re: Out of memory panic [message #36327 is a reply to message #36325] Sun, 20 May 2012 17:19 Go to previous messageGo to previous message
mdelfede is currently offline  mdelfede
Messages: 1310
Registered: September 2007
Ultimate Contributor
mirek wrote on Sun, 20 May 2012 17:13



Well, if adding "OutOfMemoryHandler" function would statisfy you, I have no problem adding it.

However, please notice that you can do very little in such handler.... You e.g. cannot even call Exclamation to report the issue...



I guess that the best would be to add a trigget with an user-settable memory level.
I mean :

::SetMemoryLimit(1000000000, THISBACK(myHandler)); // 1 GB

......
byte *x = new byte[500000000];
byte *y = new byte[500000000];
byte *z = new byte;   <<-- This one triggers the handler


Of course, the Upp allocator should, when limit reached :
1) - Disable the handler
2) - Return NULL, just in case....
3) - Allow normal usage, allowing the user handler to do whathever he wants.

Max

[Updated on: Sun, 20 May 2012 17:20]

Report message to a moderator

 
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: Thu Aug 28 08:56:42 CEST 2025

Total time taken to generate the page: 0.06580 seconds