Gnus development mailing list
 help / color / mirror / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: Daniel Pittman <daniel@rimspace.net>
Cc: ding@gnus.org
Subject: Re: Huge memory consumption on accessing large newsgroup
Date: Tue, 02 Oct 2007 06:11:40 -0500	[thread overview]
Message-ID: <m2ve9p6aab.fsf@lifelogs.com> (raw)
In-Reply-To: <874phatd0z.fsf@enki.rimspace.net> (Daniel Pittman's message of "Tue, 02 Oct 2007 13:23:56 +1000")

On Tue, 02 Oct 2007 13:23:56 +1000 Daniel Pittman <daniel@rimspace.net> wrote: 

DP> The issue with large memory consumption, as far as I could see from the
DP> thread, was that the compressed range data type was expanded to a flat
DP> list.  This caused, no surprise, huge memory use.

DP> The original problem is that the code calls `gnus-uncompress-range' on
DP> the data *at all* -- and, so, turns a nicely brief data structure into a
DP> vast bloated million-number list.

DP> The *solution* is to rebuild the algorithm to operate on the compressed
DP> version (regardless of the internal representation), not to change the
DP> representation.

You're right, I didn't know this.  I thought the memory problems were
caused by the original list.  In light of your explanation, I completely
agree that the right way is to find all instances of
`gnus-uncompress-range' and fix their consequences.  Thank you for
explaining.

DP> (And because this has been a stupidly annoying couple of week in other
DP>  areas, and because this is nice simple and essentially stress-free work
DP>  I am getting tempted to fix it myself.

DP>  So, maybe inversion lists were the way to get the code fixed after all,
DP>  if not quite so directly as expected. ;) 

The `gnus-uncompress-range' function is not called in too many places:

gnus-agent.el:7
gnus-draft.el:1
gnus-group.el:2
gnus-move.el:4
gnus-nocem.el:1
gnus-range.el:2
gnus-start.el:2
gnus-sum.el:9
nnimap.el:1
nnmaildir.el:3
nnsoup.el:1
nnvirtual.el:1

In gnus-number-of-unseen-articles-in-group for example it's called only
to find the length of the list, and in gnus-move-group-to-server only to
see if the list is not nil.  There's room for improvement.  Maybe there
should be a group API that abstracts the data structures, so subordinate
code doesn't have to know if it's a list or a compressed range?  That
would be a good first step to cleaning things up.

Ted



  reply	other threads:[~2007-10-02 11:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87wsw4u21m.fsf@gmx.de>
2007-08-10  9:08 ` Katsumi Yamaoka
2007-08-10 11:39   ` Katsumi Yamaoka
2007-08-10 12:43     ` Sven Joachim
2007-08-13 11:44       ` Katsumi Yamaoka
2007-08-13 17:30         ` Sven Joachim
2007-08-14 11:46           ` Katsumi Yamaoka
2007-09-13 10:27             ` Katsumi Yamaoka
2007-08-10 12:42   ` Sven Joachim
2007-09-29 21:04     ` Gaute Strokkenes
2007-09-30 22:11       ` Ted Zlatanov
2007-10-01  0:29         ` Katsumi Yamaoka
2007-10-01  1:04         ` Daniel Pittman
2007-10-02  2:13           ` Ted Zlatanov
2007-10-02  3:23             ` Daniel Pittman
2007-10-02 11:11               ` Ted Zlatanov [this message]
2007-10-02 12:17                 ` Daniel Pittman
2007-10-02 16:08                   ` Ted Zlatanov
2007-10-03  0:19                     ` Daniel Pittman
2007-10-02 13:33               ` Daniel Pittman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ve9p6aab.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=daniel@rimspace.net \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).