First time here? Check out the FAQ!

Ask Your Question
0

Use 'reset()' in a script

asked 11 years ago

mresimulator gravatar image

Hi experts!!

Can I use reset() in a script?

For example, if numpy arrays A, B and C are creted and i wanna free thre RAM used. Can I use reset(A,B,C) for that?

Waiting for your answers.

Thanks a lot

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
1

answered 11 years ago

mresimulator gravatar image

Thanks!

Do it help to clear memory ocupated by matrix A?

Preview: (hide)
link

Comments

I guess that depends on the Python garbage collector. Hopefully someone else can answer that, I'm not sure how often that does its thing.

kcrisman gravatar imagekcrisman ( 11 years ago )
0

answered 11 years ago

kcrisman gravatar image

This is something you can pretty much try for yourself.

$ cat test.sage 
A = matrix([[1,2,3],[4,5,6]])
print A
reset()
print A
$ sage test.sage 
[1 2 3]
[4 5 6]
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    print A
NameError: name 'A' is not defined

So I guess it works.

Preview: (hide)
link

Comments

Thanks! Do it help to clear memory ocupated by matrix A?

mresimulator gravatar imagemresimulator ( 11 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 11 years ago

Seen: 733 times

Last updated: Sep 24 '13