Ask Your Question
2

Release memory: how?

asked 2010-09-21 15:04:43 +0100

roland gravatar image

I have a program which uses large sets. After the calculation these files can be deleted (to release memory). How? Roland

edit retag flag offensive close merge delete

Comments

Can you post your code? Or the relevant parts?

ccanonc gravatar imageccanonc ( 2010-09-21 17:17:27 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2010-09-21 17:16:16 +0100

ccanonc gravatar image

Please clarify your meaning (in terminology). By files, do you mean in RAM or on disk? Both meanings are possible in programming terminology.

To release a sage/python object still in scope, call del(objname).
If you want to delete a disk file, you can find it under the "~/.sage/" directory on unix-like systems.

edit flag offensive delete link more

Comments

1

Thank you: del does the trick. A pitty that del? does not give a hint in sage....

roland gravatar imageroland ( 2010-09-22 00:42:16 +0100 )edit

The reason is that del is a keyword statement in python, not a first-class object (not everything is an object in python):

http://docs.python.org/release/2.6.6/reference/lexical_analysis.html#keywords
http://docs.python.org/release/2.6.6/reference/simple_stmts.html#the-del-statement

ccanonc gravatar imageccanonc ( 2010-09-22 01:39:36 +0100 )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

1 follower

Stats

Asked: 2010-09-21 15:04:43 +0100

Seen: 1,569 times

Last updated: Sep 22 '10