From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Thu Jun 07 2007 - 18:59:10 CDT

On 6/7/07, lily jin <lily1907_at_yahoo.com> wrote:
>
>
> case 1:
> I was writting a script. Because of some bugs it ran but only partly. So
> some file opened was not closed. When I tried to delete the file from the
> folder, I was told it was used.

btw. you could put something like this into your .vmdrc (or vmd.rc):

proc closeallfiles {args} {
for {set i 0} {$i < 1000} {incr i} {
  catch {close "file$i"}
}
}

and then type 'closeallfiles'
in case you need to close _all_ files that are still held open
by the tcl interpreter.

cheers,
    axel.

> case 2:
> when I use 'lappend lista $h ' in my script, I want to be sure that lista is
> empty when I start to run the program. I can use 'set lista {}' . But when
> I have a lot of commands like this in the script, I wish to have a clean
> memory with one command.
> I always want to have a clean memory before I ran a program.
> When this happend, especially case 1, I had to close VMD and start it again.
> 'clear' is a command in Matlab which simply cleans the memory.
> TCL has a command 'memory' which seems similar, however, it is not working
> in VMD1.8.5. I don't know if I made a mistake.
>
> Thank you for helping!
>
>
> Lily
>
>
>
> ----- Original Message ----
> From: Axel Kohlmeyer <akohlmey_at_cmm.chem.upenn.edu>
> To: lily jin <lily1907_at_yahoo.com>
> Cc: VMD-L <vmd-l_at_ks.uiuc.edu>
> Sent: Wednesday, June 6, 2007 2:35:17 PM
> Subject: Re: vmd-l: release memory in TCL
>
>
> On Wed, 6 Jun 2007, lily jin wrote:
>
> LJ> While I run a program, all the data are saved in the memory. How can
> LJ> I remove them to clear the system memory, like what 'clear' does in
> LJ> MATLAB? Thank you!
>
> there is not a single command in tcl, if i remember correctly.
> but you can unset variables and arrays. they are also
> cleaned up when used locally in a subroutine.
>
> the most memory loss in VMD is usually due to trajectory
> data (you can delete molecules to free that) and from
> creating selections without deleting them.
>
> other than that, it is easier to exit VMD and start over.
>
> do you have a specific problem or can you describe a
> scenario where something akin to 'clear' would be
> desirable?
>
> cheers,
> axel.
>
> LJ>
> LJ> Lily
> LJ>
> LJ>
> LJ>
> LJ>
> ____________________________________________________________________________________
> LJ> Be a better Globetrotter. Get better travel answers from someone who
> knows. Yahoo! Answers - Check it out.
> LJ> http://answers.yahoo.com/dir/?link=list&sid=396545469
>
> --
> =======================================================================
> Axel Kohlmeyer akohlmey_at_cmm.chem.upenn.edu http://www.cmm.upenn.edu
> Center for Molecular Modeling -- University of Pennsylvania
> Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
> tel: 1-215-898-1582, fax: 1-215-573-6233, office-tel: 1-215-898-5425
> =======================================================================
> If you make something idiot-proof, the universe creates a better idiot.
>
> ________________________________
> Looking for earth-friendly autos?
> Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
  Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.