From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65036 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Huge memory consumption on accessing large newsgroup Date: Fri, 10 Aug 2007 20:39:34 +0900 Organization: Emacsen advocacy group Message-ID: References: <87wsw4u21m.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1186746046 1187 80.91.229.12 (10 Aug 2007 11:40:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Aug 2007 11:40:46 +0000 (UTC) Cc: bugs@gnus.org, ding@gnus.org To: Sven Joachim Original-X-From: ding-owner+M13546@lists.math.uh.edu Fri Aug 10 13:40:35 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1IJSr4-00079F-2H for ding-account@gmane.org; Fri, 10 Aug 2007 13:40:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1IJSqr-0002Bb-Il; Fri, 10 Aug 2007 06:40:21 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IJSqp-0002BC-Ev for ding@lists.math.uh.edu; Fri, 10 Aug 2007 06:40:19 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IJSql-0002RQ-95 for ding@lists.math.uh.edu; Fri, 10 Aug 2007 06:40:19 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1IJSqk-0008OP-00; Fri, 10 Aug 2007 13:40:14 +0200 Original-Received: from [66.225.201.151] (port=34456 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.63) (envelope-from ) id 1IJSqE-0006EJ-2d; Fri, 10 Aug 2007 06:39:42 -0500 X-Hashcash: 1:20:070810:svenjoac@gmx.de::32O72eiBC8Nr/UbN:000Fq3 X-Hashcash: 1:20:070810:bugs@gnus.org::DeyvkvvYZpRpLln7:00002IZ7 X-Hashcash: 1:20:070810:ding@gnus.org::GEsVkH9jfJegT0tQ:00002rOY X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:vmsQC/2KPqaLcOSOc/MmqCDOSCE= X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65036 Archived-At: --=-=-= >>>>> Katsumi Yamaoka wrote: > I think the possible solution is to narrow the range into the > one with which Emacs can work lightly. Here it is: > (defadvice gnus-uncompress-range (before narrow-range (ranges) activate) > "Narrow the range if it is unreasonably wide." > (setcar ranges (max (car ranges) (- (cdr ranges) 10000)))) I overlooked that the argument of this function can be complicated. Try the following one instead: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline (defadvice gnus-uncompress-range (before narrow-range (ranges) activate) "Narrow the range if it is unreasonably wide." (let ((ttl 10000) (rest (if (and (cdr ranges) (not (consp (cdr ranges)))) (list ranges) (nreverse ranges))) range diff) (setq ranges nil) (while rest (setq range (car rest) rest (cdr rest)) (if (numberp range) (progn (push range ranges) (setq ttl (1- ttl))) (if (= ttl 1) (progn (push (cdr range) ranges) (setq ttl 0)) (setq diff (min (- (cdr range) (car range) -1) ttl) ttl (- ttl diff)) (push (cons (max (car range) (- (cdr range) diff -1)) (cdr range)) ranges))) (when (zerop ttl) (setq rest nil))))) --=-=-= Content-Disposition: inline > The 10000 will probably need to be a customizable variable. I'm > going to do it next week. --=-=-=--