insufficient memory

"Walter C. Pelissero" <[email protected]> Sun, 14 Oct 2007 23:53:01 +0200
Newsgroups gmane.lisp.clg.devel
Message-ID <[email protected]>
Can anybody tell me why this C program runs (slowly) without a problem

----------------------------------------------------------------------
#include <gtk/gtk.h>
#include <assert.h>

static void
load ()
{
  GdkPixbuf *pixbuf;
  GError *error;
  int i;

  for (i = 0; i < 10; ++i)
    {
      error = NULL;
      pixbuf = gdk_pixbuf_new_from_file("/path/to/a/large/file.jpg", &error);
      assert(pixbuf);
    }
}


int
main (int argc, char *argv[])
{
  gtk_init(&argc, &argv);
  load();
}
----------------------------------------------------------------------

but these three lines will run out of memory?

(gtk:clg-init)
(gdk:pixbuf-load "/path/to/a/large/file.jpg")
(gdk:pixbuf-load "/path/to/a/large/file.jpg")

Failed to load image '/path/to/a/large/file.jpg': Insufficient memory to load image, try exiting some applications to free memory
   [Condition of type GLIB:GLIB-ERROR]

Note that the error comes from GTK and the garbage collector doesn't
even get a chance to run.

Does it have to do with the overhead of the Lisp image and its
preallocated memory (I'm using CMUCL)?  If yes, how can I work around
this limitation?

-- 
walter pelissero
http://www.pelissero.de

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/