First time here? Check out the FAQ!

Ask Your Question
2

Release memory: how?

asked 14 years ago

roland gravatar image

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

Preview: (hide)

Comments

Can you post your code? Or the relevant parts?

ccanonc gravatar imageccanonc ( 14 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 14 years ago

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.

Preview: (hide)
link

Comments

1

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

roland gravatar imageroland ( 14 years ago )

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 ( 14 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

1 follower

Stats

Asked: 14 years ago

Seen: 1,591 times

Last updated: Sep 22 '10