Gnus development mailing list
 help / color / mirror / Atom feed
From: Kevin Greiner <kgreiner@xpediantsolutions.com>
Subject: Re: Memory exhausted while saving .newsrc.eld
Date: Mon, 31 Mar 2003 08:55:23 -0600	[thread overview]
Message-ID: <uk7efk2lg.fsf@xpediantsolutions.com> (raw)
In-Reply-To: <m37kah7ft4.fsf@quimbies.gnus.org>

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Kevin Greiner <kgreiner@xpediantsolutions.com> writes:
>
>> I just noticed that doing a 'J s' (gnus-agent-fetch-session) on
>> sufficient large number of groups can make the gnus-newsrc-alist so
>> large that you run out of memory while saving it.  I've traced the
>> problem to gnus-save-newsrc-file which writes everything to a buffer
>> then uses save-buffer to write it to a file.
>
> Wow.  Is the .newsrc.eld file really that big?

Yea, I subscribed to a huge number of groups then run fetch session
about once a week to see what happens.  So far, I've hit the
out-of-memory problem and a buffer overflow when an agent overview
file passed 108M.  I'm not sure how useful the testing is, but it's
nice to see that you can be fairly stupid and still have gnus
function.

> Anyway, I just found a bug in the .newsrc.eld code that made my file
> 7k long instead of 700k, as it apparently was supposed to be.  I've
> now bound print-length to nil the appropriate function.
>
>> I'd like to rewrite gnus-save-newsrc-file to write directly to a
>> temp file then, if no errors occur during writing, rename the temp
>> file as .newsrc.eld.
>
> I'm not sure it's possible to do any such thing in a reasonable
> fashion.  You'd have basically to implement the Lisp writer in a
> file-specific manner.

I agree.  I checked in the change on 3/2 but it's a dog executing. I
changed gnus-gnus-to-quick-newsrc-format to print to the
standard-output stream.  During normal execution, that's the temp
buffer and performance is as good as always.  If you clear the new
'gnus-save-startup-file-via-temp-buffer' variable, you can redefine
standard-output as a lambda that calls write-region.  The lambda does
some caching to avoid calling write-region on each single character,
still its slower than I'd like to see.  I haven't optimized it further
as this has a very low priority to me.

Kevin




      reply	other threads:[~2003-03-31 14:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-24 22:30 Kevin Greiner
2003-03-30  2:23 ` Lars Magne Ingebrigtsen
2003-03-31 14:55   ` Kevin Greiner [this message]

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=uk7efk2lg.fsf@xpediantsolutions.com \
    --to=kgreiner@xpediantsolutions.com \
    /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).