Hello all,

I'm running a graphics/memory intensive application that crashes when I
run it on my terminal but runs fine on a server with more RAM. I would
like the program to handle this error gracefully instead of just crashing
when I try to display the offending graph.

Does there exist a function in X to query a terminal for its amount of
free memory, or is there a way to intercept the "out of memory" error and,
say, display a dialog box informing the user that his request cannot be
fulfilled (I can handle the dialog box part, I just don't know about
intercepting the signal).

If it helps, here is the error I'm getting:

X Error of failed request: BadAlloc (insufficient resources for operation)
Major opcode of failed request: 53 (X_CreatePixmap)
Serial number of failed request: 1896
Current serial number in output stream: 4309

Any help would be appreciated. Thanks!!

************************************************** ***
Josh Lessard
Master's Student
School of Computer Science
Faculty of Mathematics
University of Waterloo
(519)888-4567 x3400
http://www.cs.uwaterloo.ca
************************************************** ***