s-news
[Top] [All Lists]

Arrays and dyanmic memory

To: S-News <s-news@wubios.wustl.edu>
Subject: Arrays and dyanmic memory
From: "Kim Elmore" <Kim.Elmore@noaa.gov>
Date: Wed, 09 Jun 2004 13:22:47 -0500
I'm dealing with a fair bit of data from various sources -- 31 different weather forecast models for 1892 locations over 55 days at 15 different times, and 5 variables. I decided to put everything for each variable into a single 1892 x 55 x 15 x 31 array. Assuming double precision, this comes out to a single object that's about 370 MB. This is well below the 2 GB limit and so I thought I'd have plenty of room to manipulate the data.

I can declare the arrays without a problem, but when I try do much with the arrays (I'm using a For loop in a Batch job), such as:

For (i = 1:n,
{
my.array1[, i, j, k] <- a.matrix[, 1]
my.array2[, i, j, k] <- b.matrix[, 2]
my.array3[, i, j, k] <- c.matrix[, 3]
my.array4[, i, j, k] <- d.matrix[, 4]
my.array5[, i, j, k] <- e.matrix[, 5]
})

S-plus runs out of dynamic memory and halts. I watch this in the Task Manager, and I never see a huge spike in memory usage, so I assume that some request for memory beyond 2 GB is being generated. Can anyone yield some insight into why this is happening? The matrices aren't very big, so even if all five arrays and matrices were resident, I'm still well under the 2 GB limit.

Kim Elmore
                          Kim Elmore, Ph.D.
                       University of Oklahoma
        Cooperative Institute for Mesoscale Meteorological Studies
"All of weather is divided into three parts: Yes, No, and Maybe. The
greatest of these is Maybe" The original Latin appears to be garbled.


<Prev in Thread] Current Thread [Next in Thread>