If Ben or Justin could post a properly indented version I am willing
to take a look.  Maybe I'm not looking at it correctly, but I'm not
sure what variables would be stored in large quantity.  In the inner
loop, the value of A is over-ridden, isn't it?  What else would stick
around?  It seems possible that it might speed things up to declare

R =  MatrixSpace(RationalField(),3)

outside the loop, and then do A= R([[23,4,17],[2,2,2],[3,4,5]]) inside
the loop.  But it looks like there are about 100*5000*30*30 = 450
million total iterations, so its not such a "little" program.

-Marshall

On Mar 3, 8:27 pm, Ben Linowitz <[email protected]> wrote:
> Justin and Alasdair,
>
> Thanks for your help.
>
> I'm sorry that you had to reformat the code. I had it written up in a
> text file and was just copying and pasting it into the terminal
> running sage. I suppose that the formatting must have gotten screwed
> up when I copied from the text file to post here.
>
> Anyway, I'm a complete novice when it comes to this. How do I delete
> variables so that the program does not hog so much memory when set to
> run for a long period of time?
>
> Thanks again,
> Ben
>
> On Mar 3, 9:12 pm, "Justin C. Walker" <[email protected]> wrote:
>
> > On Mar 3, 2010, at 14:09 , Ben Linowitz wrote:
>
> > > Thank you for your response Alex.  Here is the code:
>
> > [snip]
>
> > The code isn't usable as-is (no indenting, wrapped comments), but if
> > I've reformatted it correctly, using 'top' while this is running shows
> > that the python process is continually expanding its memory footprint.
>
> > If this is the case, Alasdair may be correct, and deleting variables
> > will help.
>
> > HTH
>
> > Justin
>
> > --
> > Justin C. Walker
> > Curmudgeon at Large
> > Director
> > Institute for the Enhancement of the Director's Income
> > --
> > Build a man a fire and he'll be warm
> > for a night.
> > Set a man on fire and he'll be warm
> > for the rest of his life.
>
> > --
> > Justin C. Walker, Curmudgeon at Large
> > Director
> > Institute for the Enhancement of the Director's income
> > -----------
> > --
> > They said it couldn't be done, but sometimes,
> > it doesn't work out that way.
> >    - Casey Stengel
> > --

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to