Memory allocation troubles



Hi,

I write an application that requires much memory to run.
It is impossible to assume that every time I ask for memory I'll get it.
The application creates many threads (up to several hundreds) each
thread taking about 0,6 MB.
And when I am out of memory I could just wait for some threads to
finish, and try again.
Aborting program is not an option, because before dying I need to clean
things up.

As I understand, when I create a widget, add a timer etc. I allocate
some memory. But in the API description there is nothing said that on
return I should get NULL value or something.

In other place I have found, that the glib library just aborts the
program if it is unable to allocate memory. As gtk is build on top of
glib, should I assume that there is no out of memory handling in gtk
also?

If reliable memory management in gtk is impossible, does anyone know
another toolkit that meet this requirement?

Regards,

Olaf






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]