Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4719 > unrolled thread

Quit versus Clear["Global`*"]

Started byThemis Matsoukas <tmatsoukas@me.com>
First post2011-09-03 12:10 +0000
Last post2011-09-07 09:40 +0000
Articles 5 — 5 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Quit versus Clear["Global`*"] Themis Matsoukas <tmatsoukas@me.com> - 2011-09-03 12:10 +0000
    Re: Quit versus Clear["Global`*"] "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-09-03 21:59 +0000
    Re: Quit versus Clear["Global`*"] David Bailey <dave@removedbailey.co.uk> - 2011-09-04 08:14 +0000
      Re: Quit versus Clear["Global`*"] "tenons@gmail.com" <tenons@gmail.com> - 2011-09-06 08:01 +0000
      Re: Quit versus Clear["Global`*"] DrMajorBob <btreat1@austin.rr.com> - 2011-09-07 09:40 +0000

#4719 — Quit versus Clear["Global`*"]

FromThemis Matsoukas <tmatsoukas@me.com>
Date2011-09-03 12:10 +0000
SubjectQuit versus Clear["Global`*"]
Message-ID<j3t5ga$58h$1@smc.vnet.net>
What is the difference between quitting the kernel and executing Clear["Global`*"]?

Is there a command to quit the kernel, instead of selecting Quit/Local from there Evaluate menu?

Thanks

[toc] | [next] | [standalone]


#4729

From"Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com>
Date2011-09-03 21:59 +0000
Message-ID<j3u800$a99$1@smc.vnet.net>
In reply to#4719
On Sat, 03 Sep 2011 13:10:50 +0100, Themis Matsoukas <tmatsoukas@me.com>  
wrote:

> What is the difference between quitting the kernel and executing  
> Clear["Global`*"]?
>
> Is there a command to quit the kernel, instead of selecting Quit/Local  
> from there Evaluate menu?
>
> Thanks
>

Definitions can be made at run-time in other contexts apart from Global`.  
For example, AutoLoad packages make their definitions mostly in the  
System` context. Quitting the kernel removes all of these, as well as  
closing all open streams and MathLink connections, unloading  
LibraryFunctions, and so on. The command used to quit the kernel is simply  
Quit or Quit[].

[toc] | [prev] | [next] | [standalone]


#4733

FromDavid Bailey <dave@removedbailey.co.uk>
Date2011-09-04 08:14 +0000
Message-ID<j3vc1k$ejo$1@smc.vnet.net>
In reply to#4719
On 03/09/2011 13:10, Themis Matsoukas wrote:
> What is the difference between quitting the kernel and executing Clear["Global`*"]?
>
> Is there a command to quit the kernel, instead of selecting Quit/Local from there Evaluate menu?
>
> Thanks
>
Quit[] will quit the kernel.

Obviously Clear["Global`*"] would not clear information that might end 
up in other contexts, whereas Quit[] will clear everything.

I never clear the global context - I just quit the kernel one way or 
another. Restarting the kernel used to be rather slow, but with the 
speed of a modern PC, there really doesn't seem much point doing 
anything else unless you specifically wish to preserve some information 
that is not in Global`.

I tend to quit the kernel quite a lot - e.g. between successive runs of 
a program - why risk the confusion that can arise when two function 
definitions end up coexisting!

David Bailey
http://www.dbaileyconsultancy.co.uk

[toc] | [prev] | [next] | [standalone]


#4779

From"tenons@gmail.com" <tenons@gmail.com>
Date2011-09-06 08:01 +0000
Message-ID<j44k19$93h$1@smc.vnet.net>
In reply to#4733
On Sep 4, 4:14 am, David Bailey <d...@removedbailey.co.uk> wrote:
> On 03/09/2011 13:10, Themis Matsoukas wrote:> What is the difference between quitting the kernel and executing Clear["Global`*"]?
>
> > Is there a command to quit the kernel, instead of selecting Quit/Local from there Evaluate menu?
>
> > Thanks
>
> Quit[] will quit the kernel.
>
> Obviously Clear["Global`*"] would not clear information that might end
> up in other contexts, whereas Quit[] will clear everything.
>
> I never clear the global context - I just quit the kernel one way or
> another. Restarting the kernel used to be rather slow, but with the
> speed of a modern PC, there really doesn't seem much point doing
> anything else unless you specifically wish to preserve some information
> that is not in Global`.
>
> I tend to quit the kernel quite a lot - e.g. between successive runs of
> a program - why risk the confusion that can arise when two function
> definitions end up coexisting!
>
> David Baileyhttp://www.dbaileyconsultancy.co.uk

I agree whole-heartedly with this post.  I've found it the only way
to stay out of trouble.

I have a related problem that I hope I can get some suggestions for.

GIF.exe has a memory leak (reported previously, acknowledged and is on
someone's todo list at Wolfram, hopefully) which makes a certain set
evaluations (which use ExportString[#,"GIF"]& extensively) unstable.
(i.e., MathKernel crashes randomly and unceremoniously, or worse).

What I would like to do is divide the set of evaluations into
segments, run them successively quitting the MathKernel after each,
and then restarting on the next segment.  The Quit[] clears out the
buildup in GIF.exe. Obviously I can do this by babysitting and
restarting each segment by hand (which I do, at approximately 15
minute intervals, painfully wasting time).

[I've tried many things including Uninstall["path/GIF.exe"] 'ing
periodically and escaping to the shell to kill the process.  Neither
improves stability. ]

How can I carry this out automatically?

[toc] | [prev] | [next] | [standalone]


#4813

FromDrMajorBob <btreat1@austin.rr.com>
Date2011-09-07 09:40 +0000
Message-ID<j47e6h$l0g$1@smc.vnet.net>
In reply to#4733
When in doubt, Quit

Amen. Other remedies are always a kludge.

Bobby

On Tue, 06 Sep 2011 02:57:01 -0500, tenons@gmail.com <tenons@gmail.com>  
wrote:

> On Sep 4, 4:14 am, David Bailey <d...@removedbailey.co.uk> wrote:
>> On 03/09/2011 13:10, Themis Matsoukas wrote:> What is the difference  
>> between quitting the kernel and executing Clear["Global`*"]?
>>
>> > Is there a command to quit the kernel, instead of selecting  
>> Quit/Local from there Evaluate menu?
>>
>> > Thanks
>>
>> Quit[] will quit the kernel.
>>
>> Obviously Clear["Global`*"] would not clear information that might end
>> up in other contexts, whereas Quit[] will clear everything.
>>
>> I never clear the global context - I just quit the kernel one way or
>> another. Restarting the kernel used to be rather slow, but with the
>> speed of a modern PC, there really doesn't seem much point doing
>> anything else unless you specifically wish to preserve some information
>> that is not in Global`.
>>
>> I tend to quit the kernel quite a lot - e.g. between successive runs of
>> a program - why risk the confusion that can arise when two function
>> definitions end up coexisting!
>>
>> David Baileyhttp://www.dbaileyconsultancy.co.uk
>
> I agree whole-heartedly with this post.  I've found it the only way
> to stay out of trouble.
>
> I have a related problem that I hope I can get some suggestions for.
>
> GIF.exe has a memory leak (reported previously, acknowledged and is on
> someone's todo list at Wolfram, hopefully) which makes a certain set
> evaluations (which use ExportString[#,"GIF"]& extensively) unstable.
> (i.e., MathKernel crashes randomly and unceremoniously, or worse).
>
> What I would like to do is divide the set of evaluations into
> segments, run them successively quitting the MathKernel after each,
> and then restarting on the next segment.  The Quit[] clears out the
> buildup in GIF.exe. Obviously I can do this by babysitting and
> restarting each segment by hand (which I do, at approximately 15
> minute intervals, painfully wasting time).
>
> [I've tried many things including Uninstall["path/GIF.exe"] 'ing
> periodically and escaping to the shell to kill the process.  Neither
> improves stability. ]
>
> How can I carry this out automatically?
>


-- 
DrMajorBob@yahoo.com

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web