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

Re: memory allocation for IDL

"Tony H Ko" <thko@mit.edu> wrote
> I am using the POLAR_SURFACE function in IDL to interpolate a surface from
> polar coordinates to rectangular coordinates.  My polar image size is 2000
> pixels by 1000 pixels of 2-byte short integer data.  The program always
> seems to stop at the TRIANGULATION portion of the routine because it says
> that there is not enough memory to allocate the required arrays.

The problem you are trying to solve is a fairly large one, i.e. based on
some quick experiments I would expect it to require O(100 MB) memory and
O(100 s) CPU time.

To investigate how much memory you are using, I suggest you create a simple
test problem and vary the number of points you feed to it. Run "help,
/MEMORY" before and after running the test problem and look at the second
number in the output, i.e. the maximum memory usage.

I ran the procedure at the end of this post for values of n from 50 to 1600.
The CPU time & memory varied quadratically with n, up to n=800 which used
70MB peak memory & 27s CPU. For n=1600 the memory exceeded the RAM on my
machine (Windows NT, 256 MB) and the CPU time stretched out to 850 s (with
much disk clattering and an enforced coffee break)!

> Does anyone know how to increase the memory allocation for IDL in Win98 OS
> environment.  My computer has 512 MB of physical memory and 2 GB of
> virtual memory, so it seems unlikely to me that my computer lacks the
> memory to do this operation.  IDL Help page indicates that one can
> increase the memory allocation for the IDL application in the Mac OS but
> doesn't specify anything for Win98.  Is it possible to do that in Windows?

It should be neither necessary nor possible to do that in Windows. The Mac
OS requires the memory for each application to be specified in advance;
Windows and Unix don't. (As I understand it, this limitation of the Mac OS
is fixed in the new OS X.)

>From my experience on Windows NT, IDL should be able to allocate the memory
required for your problem, though as I said above, this is not a small
problem and it may require most of your RAM. I have no experience with IDL
on Win 98, but the Win 9x series of OSes are known to be somewhat dodgy with
regard to memory management. Perhaps your best solution is to upgrade to
Windows NT/2000 (or even Linux).

But before you do anything drastic, check out exactly how much resources
your problem requires and see if you can scale it down a bit.

Mark Hadfield
m.hadfield@niwa.cri.nz  http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand


pro mgh_test_polar_surface, n

    compile_opt IDL2

    if n_elements(n) eq 0 then n = 50

    ; The radius:

    r = findgen(n)/n

    ; Theta:
    theta = 2*!pi*findgen(n)/n

    ; Make a function (tilted circle):
    Z = R # SIN(THETA)

    ; Show it:
    surface, POLAR_SURFACE(Z, R, THETA, /GRID)