nanogui: memory usage


Previous by date: 28 Nov 2006 22:28:37 +0000 Re: memory usage, Junior
Next by date: 28 Nov 2006 22:28:37 +0000 Re: memory usage, Junior
Previous in thread: 28 Nov 2006 22:28:37 +0000 Re: memory usage, Junior
Next in thread: 28 Nov 2006 22:28:37 +0000 Re: memory usage, Junior

Subject: Re: [nanogui] memory usage
From: "Greg Haerr" ####@####.####
Date: 28 Nov 2006 22:28:37 +0000
Message-Id: <1e1001c7133c$86f24ba0$0300a8c0@RDP>

> I have several instances of GrDrawImageFromFile() and GrDrawImageToFit().
In the case of tha latter,
I have an array of images that is initialized at startup and that function
simply pulls the correct image as needed.

> It looks like if I select an image from this array and map the window,
then later timeout and remap the same image (this may happen several times),
that seems to be where the memory usage problem is. Since, this image_id
(for GrDrawImageToFit()) is fixed in the array, and simply reloaded, I'm not
sure why it would use additional memory.
Do I need to FreeImage first? If so, I'll have to reinit the array which
shouldn't be necessary. What about GrDrawImageFromFile()? What happens when
the window is unmap?

GrDrawImage* functions have nothing to do with window map/unmap.
The draw image functions use an internal id to reference a server-stored
data structure that has the bits used to draw the image.  The application
program then uses these bits as the source to draw on a window.

GrFreeImage should be called when you will no longer be referencing
the image you're requested the server to store.

Regards,

Greg


Previous by date: 28 Nov 2006 22:28:37 +0000 Re: memory usage, Junior
Next by date: 28 Nov 2006 22:28:37 +0000 Re: memory usage, Junior
Previous in thread: 28 Nov 2006 22:28:37 +0000 Re: memory usage, Junior
Next in thread: 28 Nov 2006 22:28:37 +0000 Re: memory usage, Junior


Powered by ezmlm-browse 0.20.