Memory allocation problem [message #63973] |
Wed, 26 November 2008 07:56  |
kodark
Messages: 1 Registered: November 2008
|
Junior Member |
|
|
Hi all,
I am a beginner-level user of IDL. Recently I run into the memory
allocation problem: 'unable to allocate memory'. I loaded a large
image (11820*11820, float, about 530M) into an array. Then when I
tried to create two new arrays of the same size, the program said
'unable to allocate memory'.
I have read a lot of articles about this problem on the net, but I
still cannot solve this problem. My computer runs 32-bit Windows XP
with 4GB RAM and I have assigned 10GB from hard drive to Virtual
Memory. The virtual memory looks contiguous in the Disk Defragmenter
program. I am curious about the following output.
IDL> help,/memory
heap memory used: 681301, max: 681324, gets: 765,
frees: 413
Then I executed the MemTest program provided by ittvis
% Compiled module: MEMTEST.
Memory block # 1: 806 Mb (total: 806 Mb)
Memory block # 2: 390 Mb (total: 1196 Mb)
Memory block # 3: 214 Mb (total: 1410 Mb)
Memory block # 4: 143 Mb (total: 1553 Mb)
Memory block # 5: 66 Mb (total: 1619 Mb)
Memory block # 6: 59 Mb (total: 1678 Mb)
Memory block # 7: 56 Mb (total: 1734 Mb)
Memory block # 8: 40 Mb (total: 1774 Mb)
Memory block # 9: 27 Mb (total: 1801 Mb)
Memory block #10: 23 Mb (total: 1824 Mb)
It is obvious that the second largest block is less than 530M.
Then
IDL> help,/memory
heap memory used: 685533, max: 1913289245, gets: 789,
frees: 433
The heap memory max increased from 681324 to 1913289245.
I want to know why the virtual memory is not recognized and used? why
the heap memory max changed?
Thank you.
Kodark
|
|
|
Re: Memory allocation problem [message #64100 is a reply to message #63973] |
Wed, 26 November 2008 14:28  |
b_gom
Messages: 105 Registered: April 2003
|
Senior Member |
|
|
Maybe not helpful for your specific problem, but if you really need
big arrays then just take advantage of a 64-bit OS and cheap RAM:
IDL> memtest
Memory block # 1: 2047 Mb (total: 2047 Mb)
Memory block # 2: 2047 Mb (total: 4094 Mb)
Memory block # 3: 2047 Mb (total: 2045 Mb)
Memory block # 4: 2047 Mb (total: 4092 Mb)
Memory block # 5: 2047 Mb (total: 2043 Mb)
Memory block # 6: 570 Mb (total: 2613 Mb)
WinXP x64, 8GB RAM, IDL 7.
|
|
|
Re: Memory allocation problem [message #64119 is a reply to message #63973] |
Wed, 26 November 2008 08:58  |
R.G. Stockwell
Messages: 363 Registered: July 1999
|
Senior Member |
|
|
<kodark@gmail.com> wrote in message
news:0b01ac28-0dfe-44f6-8f15-75782d6c2f78@x8g2000yqk.googleg roups.com...
> Hi all,
>
> I am a beginner-level user of IDL. Recently I run into the memory
> allocation problem: 'unable to allocate memory'. I loaded a large
> image (11820*11820, float, about 530M) into an array. Then when I
> tried to create two new arrays of the same size, the program said
> 'unable to allocate memory'.
>
> I have read a lot of articles about this problem on the net, but I
> still cannot solve this problem. My computer runs 32-bit Windows XP
> with 4GB RAM and I have assigned 10GB from hard drive to Virtual
> Memory. The virtual memory looks contiguous in the Disk Defragmenter
> program. I am curious about the following output.
>
> IDL> help,/memory
> heap memory used: 681301, max: 681324, gets: 765,
> frees: 413
>
> Then I executed the MemTest program provided by ittvis
>
> % Compiled module: MEMTEST.
> Memory block # 1: 806 Mb (total: 806 Mb)
> Memory block # 2: 390 Mb (total: 1196 Mb)
> Memory block # 3: 214 Mb (total: 1410 Mb)
> Memory block # 4: 143 Mb (total: 1553 Mb)
> Memory block # 5: 66 Mb (total: 1619 Mb)
> Memory block # 6: 59 Mb (total: 1678 Mb)
> Memory block # 7: 56 Mb (total: 1734 Mb)
> Memory block # 8: 40 Mb (total: 1774 Mb)
> Memory block # 9: 27 Mb (total: 1801 Mb)
> Memory block #10: 23 Mb (total: 1824 Mb)
>
> It is obvious that the second largest block is less than 530M.
>
> Then
> IDL> help,/memory
> heap memory used: 685533, max: 1913289245, gets: 789,
> frees: 433
>
> The heap memory max increased from 681324 to 1913289245.
>
> I want to know why the virtual memory is not recognized and used? why
> the heap memory max changed?
>
> Thank you.
>
> Kodark
the quick solutions are to switch to linux. Windows only lets you
get at 2gb for any one process, and even worse, Windows scatters
DLLs throughout memory which makes large contiguous memory blocks
(which IDL requires) unlikely. Perhaps try going with a very bare bones
windows, with no programs starting up, no virus, firewall, etc (unplug
from network maybe).
I had these problems all the time (trying to get 3 1gb arrays), and it
was impossible in windows, and flaky on linux. So I moved to a 64b machine.
Cheers,
bob
PS try googling through google groups to see all the old messages
on this thread.
|
|
|