[S] Memory problems (update)

Matthew Wiener (mcw@ln.nimh.nih.gov)
Sun, 22 Feb 1998 11:00:48 -0500 (EST)


Prof. Ripley pointed out that I should have tried passing the matrix
globally before posting. True enough -- I was hoping for one of those
famed instant solutions from the list, and hurried. My apologies. In any
case, I have now tried it, and it doesn't work. I have exactly the same
problem as before, although it progresses somewhat more slowly.

Another person asked about what I'm running this on. I'm running it on a
Silicon Graphics machine with Irix 6.4 and >128 MB of memory.

The main problem seems to me to be keeping Splus from making copies of
things. The original posting follows.

________________________________________________________________________

I am working with an extremely large minimization
problem. I have 1325 entries in the vector over which I am minimizing.

I've been using nlminb.
One of the things I do is pass it a vector of conditional
probabilities, which is of dimension 1325 x 1325.

The memory size Splus is using (as measured by the function memory.size)
grows many times when either the function I'm minimizing or the gradient
function is called. It always grows by the size of a 1325 x 1325 array.

I've checked my functions, and I'm not calculating any 1325x1325 arrays,
even as temporary results. This suggests to me that Splus is making
copies of the 1325x1325 matrix that I pass through nlminb.
This is confirmed by the fact that the memory goes up exactly on the step
when I use the matrix.

So far, I haven't found any documentation on how to prevent this.
I'm looking into making the matrix a global variable (or assigning it to
my frame) so that I don't have to pass it, to see whether that might help.

Any suggestions?

Thanks,
Matt Wiener

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news