After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 168417 - g_malloc/malloc0/realloc OOM handling
g_malloc/malloc0/realloc OOM handling
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-02-24 17:40 UTC by Benoît Dejean
Modified: 2013-02-03 01:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.45 KB, patch)
2005-03-08 15:52 UTC, Benoît Dejean
reviewed Details | Review

Description Benoît Dejean 2005-02-24 17:40:39 UTC
I think it would be nice to call g_blow_chunks() when system is out of memory,
instead of re-throwing malloc/calloc/realloc failure.
Comment 1 Matthias Clasen 2005-02-25 19:26:03 UTC
If you want to go in that direction, it would probably be a good idea to add a
way to register a blow_caches() function, so that apps get a chance to shrink
application-level caches at the same time.
Comment 2 Benoît Dejean 2005-02-25 20:01:02 UTC
I'd like g_malloc to be a bit smarter that standard malloc: do its best before
crashing. What about g_try_malloc/g_try_realloc : should they also try to
release some memory before returning NULL ?

Registering blow_cache() functions sounds good, but i don't know whether or not
user should be able to manually blow_all_registred_caches().
Comment 3 Benoît Dejean 2005-03-08 15:52:23 UTC
Created attachment 38418 [details] [review]
proposed patch

simple patch without the ability to register cleanup functions.
Comment 4 Matthias Clasen 2005-05-18 13:52:46 UTC
We should probably wait for the outcome of the discussion in bug 118439 before
doing anything here. Maybe blow_chunks() will be irrelevant after that...
Comment 5 Matthias Clasen 2013-02-03 01:48:51 UTC
closing out some old bugs