Thanks to Prof. Ripley and Bert Gunter for answering my query.
Prof. Ripley points out that running a .ssc script effectively sources()
it. Because it needs to be able to back out if it fails, it uses quite a
bit of memory.
He suggested using
sqpe < foo.ssc > foo.out
which avoids all the build up (as will Splus /BATCH).
I am happily using Splus /BATCH now, and that's preventing memory build up.
I used the assign() function instead of dbwrite(), because dbwrite seems to
not properly write the object names, so I can't find them later, even after
using synchronize(). dbwrite() seems to not wrtite the object names to the
_nonfi file.
The original question was:
>
> Hello,
>
> I have encountered a problem running scripts in S+ 2000 on Win NT 4.0.
>
> I have a series of lengthy operations that run on large datasets (I
> estimate overall 6+ hours computing time on my PIII 933 MHz). I built an
> .ssc file to run them as a sequence of assignment commands, but when I run
> it S+ takes up more and more memory until it eventually bombs and nothing
> is committed.
>
> Note that this happend using a series of commands in the form:
>
> east.dem.nw.7.0 <<- par.map.nw(get("east.dem", immediate = T),7,0)
>
> (where par.map.nw is a function that call a C DLL)
>
> I also tried
>
> assign("east.dem.nw.7.0", par.map.nw(get("east.dem", immediate =
> T),7,0),immediate=T)
>
> or
>
> dbwrite("d:\\_demconic","east.dem.nw.7.0", par.map.nw(get("east.dem",
> immediate = T),7,0))
>
> In all cases, following S+ with the NT task manager, I can see that memory
> is not freed when each operation is concluded, but only when the .ssc file
> finishes running successfully (in the dbwrite case I don't even seem to be
> able to find the object with its proper name once it has been written to
> the attached database).
>
> Any insight?
Thanks to Prof. Ripley and
|