all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs eats up my memory while viewing images
@ 2017-06-08 11:58 Danny YUE
  2017-06-08 14:54 ` Alexis
  2017-06-08 15:09 ` Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: Danny YUE @ 2017-06-08 11:58 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

Hi guys,

I was viewing some (well, lots of) old images using image+ in Emacs.
Then I noticed that it opens new image slower and slower.
I ran command `free -h` and noticed that my memory was almost totally
consumed.
Then I killed Emacs and memory consumption dropped to normal level.

I suspect there is something wrong with it, because when I press "N" for
`image-next-file`, the old image file is removed from buffer list, thus
the memory consumed by it *should* be released...

Any help is appreciated.

Danny



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

* Re: Emacs eats up my memory while viewing images
  2017-06-08 11:58 Emacs eats up my memory while viewing images Danny YUE
@ 2017-06-08 14:54 ` Alexis
  2017-06-08 15:54   ` Danny YUE
  2017-06-08 15:09 ` Eli Zaretskii
  1 sibling, 1 reply; 6+ messages in thread
From: Alexis @ 2017-06-08 14:54 UTC (permalink / raw)
  To: Danny YUE; +Cc: help-gnu-emacs@gnu.org


Danny YUE <sheepduke@gmail.com> writes:

> I suspect there is something wrong with it, because when I press 
> "N"
> for `image-next-file`, the old image file is removed from buffer 
> list,
> thus the memory consumed by it *should* be released...

Not necessarily; it depends on the OS. Some only mark memory as
again available after the application exits. What OS are you 
running
Emacs on?


Alexis.



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

* Re: Emacs eats up my memory while viewing images
  2017-06-08 11:58 Emacs eats up my memory while viewing images Danny YUE
  2017-06-08 14:54 ` Alexis
@ 2017-06-08 15:09 ` Eli Zaretskii
  2017-06-08 16:06   ` Danny YUE
  1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2017-06-08 15:09 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Danny YUE <sheepduke@gmail.com>
> Date: Thu, 08 Jun 2017 19:58:03 +0800
> 
> I was viewing some (well, lots of) old images using image+ in Emacs.
> Then I noticed that it opens new image slower and slower.
> I ran command `free -h` and noticed that my memory was almost totally
> consumed.
> Then I killed Emacs and memory consumption dropped to normal level.
> 
> I suspect there is something wrong with it, because when I press "N" for
> `image-next-file`, the old image file is removed from buffer list, thus
> the memory consumed by it *should* be released...

The memory isn't released immediately because Emacs caches images for
better performance.  And even if Emacs does free the memory used for
the image and its buffer, it doesn't necessarily return that memory to
the OS; that depend on the build and the OS you are using.

Try the command "M-x clear-image-cache".  If that helps, you may wish
to customize your value of image-cache-eviction-delay.



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

* Re: Emacs eats up my memory while viewing images
  2017-06-08 14:54 ` Alexis
@ 2017-06-08 15:54   ` Danny YUE
  0 siblings, 0 replies; 6+ messages in thread
From: Danny YUE @ 2017-06-08 15:54 UTC (permalink / raw)
  To: Alexis; +Cc: help-gnu-emacs@gnu.org, Danny YUE


On 2017-06-08 14:54, Alexis <flexibeast@gmail.com> wrote:
> Danny YUE <sheepduke@gmail.com> writes:
>
>> I suspect there is something wrong with it, because when I press
>> "N"
>> for `image-next-file`, the old image file is removed from buffer
>> list,
>> thus the memory consumed by it *should* be released...
>
> Not necessarily; it depends on the OS. Some only mark memory as
> again available after the application exits. What OS are you
> running
> Emacs on?
>
>
> Alexis.

I am running Emacs on a Gentoo system.
Well, customized kernel, hard to say.

I forgot to mention that more than 1 GB (out of 8GB) memory was released
after I killed Emacs. Is that really *normal*?

But thanks, you inspired me ;-)

Danny



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

* Re: Emacs eats up my memory while viewing images
  2017-06-08 15:09 ` Eli Zaretskii
@ 2017-06-08 16:06   ` Danny YUE
  2017-06-08 16:14     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Danny YUE @ 2017-06-08 16:06 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


On 2017-06-08 15:09, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Danny YUE <sheepduke@gmail.com>
>> Date: Thu, 08 Jun 2017 19:58:03 +0800
>> 
>> I was viewing some (well, lots of) old images using image+ in Emacs.
>> Then I noticed that it opens new image slower and slower.
>> I ran command `free -h` and noticed that my memory was almost totally
>> consumed.
>> Then I killed Emacs and memory consumption dropped to normal level.
>> 
>> I suspect there is something wrong with it, because when I press "N" for
>> `image-next-file`, the old image file is removed from buffer list, thus
>> the memory consumed by it *should* be released...
>
> The memory isn't released immediately because Emacs caches images for
> better performance.  And even if Emacs does free the memory used for
> the image and its buffer, it doesn't necessarily return that memory to
> the OS; that depend on the build and the OS you are using.
>
> Try the command "M-x clear-image-cache".  If that helps, you may wish
> to customize your value of image-cache-eviction-delay.

In fact `clear-image-cache` is not really an interactive command, it is
a function.

The current value of `image-cache-eviction-delay` is 300.
I will try to set it to a smaller value and have a try.

Thanks.

Danny



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

* Re: Emacs eats up my memory while viewing images
  2017-06-08 16:06   ` Danny YUE
@ 2017-06-08 16:14     ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2017-06-08 16:14 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Danny YUE <sheepduke@gmail.com>
> Cc: help-gnu-emacs@gnu.org
> Date: Fri, 09 Jun 2017 00:06:49 +0800
> 
> > Try the command "M-x clear-image-cache".  If that helps, you may wish
> > to customize your value of image-cache-eviction-delay.
> 
> In fact `clear-image-cache` is not really an interactive command, it is
> a function.

Oops, you are right.  Sorry.  In any case, you can invoke it via
"M-:", to see if that helps.



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

end of thread, other threads:[~2017-06-08 16:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-08 11:58 Emacs eats up my memory while viewing images Danny YUE
2017-06-08 14:54 ` Alexis
2017-06-08 15:54   ` Danny YUE
2017-06-08 15:09 ` Eli Zaretskii
2017-06-08 16:06   ` Danny YUE
2017-06-08 16:14     ` Eli Zaretskii

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.