From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id CDB5E1FB06 for ; Sat, 9 Oct 2021 12:03:36 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/4] view: discard Eml->{bdy} when done using Date: Sat, 9 Oct 2021 12:03:34 +0000 Message-Id: <20211009120336.2057-3-e@80x24.org> In-Reply-To: <20211009120336.2057-1-e@80x24.org> References: <20211009120336.2057-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We can release the raw body buffer once we've obtained a copy of the decoded buffer. This reduces memory pressure ahead of some expensive diff processing. --- lib/PublicInbox/View.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 64e73234..a6944b80 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -533,6 +533,7 @@ sub attach_link ($$$$;$) { my $nl = $idx eq '1' ? '' : "\n"; # like join("\n", ...) my $size = length($part->body); + delete $part->{bdy}; # save memory # hide attributes normally, unless we want to aid users in # spotting MUA problems: @@ -632,6 +633,7 @@ sub add_text_body { # callback for each_part attach_link($ctx, $ct, $p, $fn, $err); $$rv .= "\n"; } + delete $part->{bdy}; # save memory foreach my $cur (@sections) { if ($cur =~ /\A>/) { # we use a here to allow users to specify