Memory Issues [message #6358] |
Fri, 21 June 1996 00:00  |
jgradeck
Messages: 1 Registered: June 1996
|
Junior Member |
|
|
Question for PV-WAVE developers. We have some PV-WAVE legacy code which
basically loads images, allows users to 'enhance' the images, and displays
the image again. The application allows these actions to occur at the user's
choice. After several images, we get a memory error saying we are out of
display memory. I am checked the code to verify that we release the memory
(as a Computer Scientist, I would prefer a free(a) instead of setting an
array to 0 indicating the memory has been freed). If we close the applications
and start again, we have memory again.
Being somewhat familiar with UNIX and X windows, does it appear we are running
into 'c' memory issues or is something happening to the X windows display
memory?
I understand the images we import are large but if I release an image and reload
it, the system should be doing housekeeping on memory.
Thanks!!
Joe
|
|
|
Re: Memory Issues [message #6497 is a reply to message #6358] |
Mon, 24 June 1996 00:00  |
rivers
Messages: 228 Registered: March 1991
|
Senior Member |
|
|
In article <4qedee$grj@hacgate2.hac.com>, jgradeck@redwood.hac.com (Joseph David Gradecki) writes:
> Question for PV-WAVE developers. We have some PV-WAVE legacy code which
> basically loads images, allows users to 'enhance' the images, and displays
> the image again. The application allows these actions to occur at the user's
> choice. After several images, we get a memory error saying we are out of
> display memory. I am checked the code to verify that we release the memory
> (as a Computer Scientist, I would prefer a free(a) instead of setting an
> array to 0 indicating the memory has been freed). If we close the applications
> and start again, we have memory again.
>
> Being somewhat familiar with UNIX and X windows, does it appear we are running
> into 'c' memory issues or is something happening to the X windows display
> memory?
>
> I understand the images we import are large but if I release an image and reload
> it, the system should be doing housekeeping on memory.
This is a problem with IDL/PV-WAVE which is discussed in the FAQ. Basically,
PV-WAVE does release the memory with free(a), so it is available to be
reallocated later. However, the problem is fragmentation: if after freeing a
large array you then allocate a simple scaler, the scaler allocation will
use part of the previously freed block, such that it cannot be used to
hold an array that large again. One solution is to rewrite your code so you
always put your images in the SAME location, so that you never allocate/free
memory. Another is to use the TEMPORARY() function whenever possible.
____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
|
|
|