all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* clear the kill-ring and free memory?
@ 2013-09-12 18:47 unfrostedpoptart
  2013-09-12 19:28 ` Drew Adams
  2013-09-13  4:08 ` Stefan Monnier
  0 siblings, 2 replies; 13+ messages in thread
From: unfrostedpoptart @ 2013-09-12 18:47 UTC (permalink / raw)
  To: help-gnu-emacs

Hi.

I've been having a lot of emacs (24.3.1 linux) hangs/crashes/cpu-hogging related to too much stuff in the kill-ring.  I'm looking for a nice, safe way to empty it.  I've searched around a lot and haven't seen a good solution.  There's 

(setq kill-ring nil) 
(garbage-collect)

but I don't know if that would leave some clipboard functions/variables in an illegal state.

Thanks!

 David


^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: clear the kill-ring and free memory?
  2013-09-12 18:47 clear the kill-ring and free memory? unfrostedpoptart
@ 2013-09-12 19:28 ` Drew Adams
  2013-09-12 20:11   ` Michael Heerdegen
  2013-09-13  4:08 ` Stefan Monnier
  1 sibling, 1 reply; 13+ messages in thread
From: Drew Adams @ 2013-09-12 19:28 UTC (permalink / raw)
  To: unfrostedpoptart, help-gnu-emacs

> (setq kill-ring nil)
> (garbage-collect)
> 
> but I don't know if that would leave some clipboard functions/variables in
> an illegal state.

Nope. Go for it. No problem.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: clear the kill-ring and free memory?
  2013-09-12 19:28 ` Drew Adams
@ 2013-09-12 20:11   ` Michael Heerdegen
  2013-09-12 20:56     ` Drew Adams
  0 siblings, 1 reply; 13+ messages in thread
From: Michael Heerdegen @ 2013-09-12 20:11 UTC (permalink / raw)
  To: help-gnu-emacs

Drew Adams <drew.adams@oracle.com> writes:

> > (setq kill-ring nil)
> > (garbage-collect)
> > 
> > but I don't know if that would leave some clipboard
> > functions/variables in
> > an illegal state.
>
> Nope. Go for it. No problem.

Sure?  What about `kill-ring-yank-pointer' and `yank-menu'?

Michael.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: clear the kill-ring and free memory?
  2013-09-12 20:11   ` Michael Heerdegen
@ 2013-09-12 20:56     ` Drew Adams
  2013-09-12 21:28       ` Michael Heerdegen
  0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2013-09-12 20:56 UTC (permalink / raw)
  To: Michael Heerdegen, help-gnu-emacs

> > > (setq kill-ring nil)
> > > (garbage-collect)
> > >
> > > but I don't know if that would leave some clipboard
> > > functions/variables in an illegal state.
> >
> > Nope. Go for it. No problem.
> 
> Sure?  What about `kill-ring-yank-pointer' and `yank-menu'?

What about them?  I don't think that either is a problem (e.g.,
"illegal state").  But I'll be glad to be shown wrong.

`Edit > Paste from Kill Menu' won't be emptied too, but there
is no problem with that, AFAIK.

If you are worried, do this instead:

(setq kill-ring-max 1)
Copy some text.
(setq kill-ring-max 60) ; or whatever



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: clear the kill-ring and free memory?
  2013-09-12 20:56     ` Drew Adams
@ 2013-09-12 21:28       ` Michael Heerdegen
  2013-09-12 22:08         ` Drew Adams
       [not found]         ` <mailman.1994.1379023714.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 13+ messages in thread
From: Michael Heerdegen @ 2013-09-12 21:28 UTC (permalink / raw)
  To: help-gnu-emacs

Drew Adams <drew.adams@oracle.com> writes:

> > Sure?  What about `kill-ring-yank-pointer' and `yank-menu'?
> 
> What about them?  I don't think that either is a problem (e.g.,
> "illegal state").  But I'll be glad to be shown wrong.

`kill-ring-yank-pointer': dunno too, but you might get surprised, I
would set it nil, too.

`yank-menu': Since unfrostedpoptart wants to free memory, I assume that
he has some really huge kills in his kill ring and wants to get rid of
these objects in memory.  These kills are stored in `yank-menu' too, so
you'll have to reset this variable to garbage-collect those kills.


Michael.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: clear the kill-ring and free memory?
  2013-09-12 21:28       ` Michael Heerdegen
@ 2013-09-12 22:08         ` Drew Adams
  2013-09-13  1:22           ` Michael Heerdegen
       [not found]         ` <mailman.1994.1379023714.10748.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 13+ messages in thread
From: Drew Adams @ 2013-09-12 22:08 UTC (permalink / raw)
  To: Michael Heerdegen, help-gnu-emacs

> > > Sure?  What about `kill-ring-yank-pointer' and `yank-menu'?
> >
> > What about them?  I don't think that either is a problem (e.g.,
> > "illegal state").  But I'll be glad to be shown wrong.
> 
> `kill-ring-yank-pointer': dunno too, but you might get surprised, I
> would set it nil, too.

I really don't think so.  Did you try it?

> `yank-menu': Since unfrostedpoptart wants to free memory, I assume that
> he has some really huge kills in his kill ring and wants to get rid of
> these objects in memory.  These kills are stored in `yank-menu' too, so
> you'll have to reset this variable to garbage-collect those kills.

Agreed.

I was answering only the question about problems - an "illegal state"
from emptying `kill-ring'.  But you are right that emptying it alone
does not solve the memory problem.

`kill-ring-max' takes care of both sets of pastables.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: clear the kill-ring and free memory?
       [not found]         ` <mailman.1994.1379023714.10748.help-gnu-emacs@gnu.org>
@ 2013-09-12 22:25           ` unfrostedpoptart
  0 siblings, 0 replies; 13+ messages in thread
From: unfrostedpoptart @ 2013-09-12 22:25 UTC (permalink / raw)
  To: help-gnu-emacs

On Thursday, September 12, 2013 3:08:10 PM UTC-7, Drew Adams wrote:
> > > > Sure?  What about `kill-ring-yank-pointer' and `yank-menu'?
> 
> > >
> 
> > > What about them?  I don't think that either is a problem (e.g.,
> 
> > > "illegal state").  But I'll be glad to be shown wrong.
> 
> > 
> 
> > `kill-ring-yank-pointer': dunno too, but you might get surprised, I
> 
> > would set it nil, too.
> 
> 
> 
> I really don't think so.  Did you try it?
> 
> 
> 
> > `yank-menu': Since unfrostedpoptart wants to free memory, I assume that
> 
> > he has some really huge kills in his kill ring and wants to get rid of
> 
> > these objects in memory.  These kills are stored in `yank-menu' too, so
> 
> > you'll have to reset this variable to garbage-collect those kills.
> 
> 
> 
> Agreed.
> 
> 
> 
> I was answering only the question about problems - an "illegal state"
> 
> from emptying `kill-ring'.  But you are right that emptying it alone
> 
> does not solve the memory problem.
> 
> 
> 
> `kill-ring-max' takes care of both sets of pastables.

Thanks for the help!


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: clear the kill-ring and free memory?
  2013-09-12 22:08         ` Drew Adams
@ 2013-09-13  1:22           ` Michael Heerdegen
  2013-09-13  3:54             ` Drew Adams
  0 siblings, 1 reply; 13+ messages in thread
From: Michael Heerdegen @ 2013-09-13  1:22 UTC (permalink / raw)
  To: help-gnu-emacs

Drew Adams <drew.adams@oracle.com> writes:

> > `kill-ring-yank-pointer': dunno too, but you might get surprised, I
> > would set it nil, too.
>
> I really don't think so.  Did you try it?

Indeed, I found no problem.

> > `yank-menu': Since unfrostedpoptart wants to free memory, I assume that
> > he has some really huge kills in his kill ring and wants to get rid of
> > these objects in memory.  These kills are stored in `yank-menu' too, so
> > you'll have to reset this variable to garbage-collect those kills.
>
> Agreed.
>
> I was answering only the question about problems - an "illegal state"
> from emptying `kill-ring'.  But you are right that emptying it alone
> does not solve the memory problem.
>
> `kill-ring-max' takes care of both sets of pastables.

There is also `buffers-menu-max-size', at least here in 24.3.


Regards,

Michael.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: clear the kill-ring and free memory?
  2013-09-13  1:22           ` Michael Heerdegen
@ 2013-09-13  3:54             ` Drew Adams
  2013-09-13 12:13               ` Michael Heerdegen
  0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2013-09-13  3:54 UTC (permalink / raw)
  To: Michael Heerdegen, help-gnu-emacs

> > `kill-ring-max' takes care of both sets of pastables.
> 
> There is also `buffers-menu-max-size', at least here in 24.3.

I don't understand.  Did you mean that it somehow affects the length
of `kill-ring' or `yank-menu'?  (I don't see where it does that.)

Or did you just mean that it is another place where one can limit the
memory used?  Yes, that could be helpful if the value is nil (no
limit).  But it is pretty small by default - just 10 buffer names.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: clear the kill-ring and free memory?
  2013-09-12 18:47 clear the kill-ring and free memory? unfrostedpoptart
  2013-09-12 19:28 ` Drew Adams
@ 2013-09-13  4:08 ` Stefan Monnier
  1 sibling, 0 replies; 13+ messages in thread
From: Stefan Monnier @ 2013-09-13  4:08 UTC (permalink / raw)
  To: help-gnu-emacs

> I've been having a lot of emacs (24.3.1 linux) hangs/crashes/cpu-hogging
> related to too much stuff in the kill-ring.

Sounds highly unlikely.  What makes you think the problem is in "too
much stuff in the kill-ring" rather than elsewhere?


        Stefan




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: clear the kill-ring and free memory?
  2013-09-13  3:54             ` Drew Adams
@ 2013-09-13 12:13               ` Michael Heerdegen
  2013-09-13 15:20                 ` Drew Adams
  0 siblings, 1 reply; 13+ messages in thread
From: Michael Heerdegen @ 2013-09-13 12:13 UTC (permalink / raw)
  To: help-gnu-emacs

Drew Adams <drew.adams@oracle.com> writes:

> > > `kill-ring-max' takes care of both sets of pastables.
> > 
> > There is also `buffers-menu-max-size', at least here in 24.3.
>
> I don't understand.  Did you mean that it somehow affects the length
> of `kill-ring' or `yank-menu'?  (I don't see where it does that.)

Oops, I meant `yank-menu-length'.

Michael.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: clear the kill-ring and free memory?
  2013-09-13 12:13               ` Michael Heerdegen
@ 2013-09-13 15:20                 ` Drew Adams
  2013-09-13 16:34                   ` Michael Heerdegen
  0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2013-09-13 15:20 UTC (permalink / raw)
  To: Michael Heerdegen, help-gnu-emacs

> Oops, I meant `yank-menu-length'.

FWIW, in spite of the name, that var is not about the length of the menu
(`yank-menu'), which is controlled by `kill-ring-max'.

`yank-menu-length' controls the length of each menu *item* (each kill
shown in the menu - the max number of chars).  If a kill is longer than
that length then the menu item shows it with elision, e.g. "Foo Ba...".

So yes, if you have large kills, that var can save memory too.  Just
wanted to point out that its name is somewhat misleading - it does
not control the length of the yank menu.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: clear the kill-ring and free memory?
  2013-09-13 15:20                 ` Drew Adams
@ 2013-09-13 16:34                   ` Michael Heerdegen
  0 siblings, 0 replies; 13+ messages in thread
From: Michael Heerdegen @ 2013-09-13 16:34 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs

Drew Adams <drew.adams@oracle.com> writes:

> > Oops, I meant `yank-menu-length'.
>
> FWIW, in spite of the name, that var is not about the length of the menu
> (`yank-menu'), which is controlled by `kill-ring-max'.
>
> `yank-menu-length' controls the length of each menu *item* (each kill
> shown in the menu - the max number of chars).  If a kill is longer than
> that length then the menu item shows it with elision, e.g. "Foo Ba...".

Interesting.  Yes, the name is misleading - thanks for clarifying.

Michael.



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-09-13 16:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-12 18:47 clear the kill-ring and free memory? unfrostedpoptart
2013-09-12 19:28 ` Drew Adams
2013-09-12 20:11   ` Michael Heerdegen
2013-09-12 20:56     ` Drew Adams
2013-09-12 21:28       ` Michael Heerdegen
2013-09-12 22:08         ` Drew Adams
2013-09-13  1:22           ` Michael Heerdegen
2013-09-13  3:54             ` Drew Adams
2013-09-13 12:13               ` Michael Heerdegen
2013-09-13 15:20                 ` Drew Adams
2013-09-13 16:34                   ` Michael Heerdegen
     [not found]         ` <mailman.1994.1379023714.10748.help-gnu-emacs@gnu.org>
2013-09-12 22:25           ` unfrostedpoptart
2013-09-13  4:08 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.