Ask Your Question
0

Use 'reset()' in a script

asked 2013-09-24 01:08:32 -0500

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

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-09-24 04:31:34 -0500

mresimulator gravatar image

Thanks!

Do it help to clear memory ocupated by matrix A?

edit flag offensive delete link more

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 ( 2013-09-24 06:38:01 -0500 )edit
0

answered 2013-09-24 02:58:21 -0500

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.

edit flag offensive delete link more

Comments

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

mresimulator gravatar imagemresimulator ( 2013-09-24 04:31:32 -0500 )edit

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: 2013-09-24 01:08:32 -0500

Seen: 258 times

Last updated: Sep 24 '13