Ask Your Question

Release memory: how?

asked 2010-09-21 08:04:43 -0500

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


Can you post your code? Or the relevant parts?

ccanonc gravatar imageccanonc ( 2010-09-21 10:17:27 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2010-09-21 10:16:16 -0500

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

answered 2010-09-21 17:42:16 -0500

roland gravatar image

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

edit flag offensive delete link more


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

ccanonc gravatar imageccanonc ( 2010-09-21 18:39:36 -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

1 follower


Asked: 2010-09-21 08:04:43 -0500

Seen: 764 times

Last updated: Sep 21 '10