From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#19393: 25.0.50; Emacs cannot determine coding system of ISO-8859 encoded files Date: Sat, 20 Dec 2014 09:27:39 +0200 Message-ID: <83ioh6srv8.fsf@gnu.org> References: <87sigfpqmx.fsf@thinkpad-t440p.tsdh.org> <85oar3xwc1.fsf@iznogoud.viz> <871tnzs7y6.fsf@thinkpad-t440p.tsdh.org> <85mw6m4aqs.fsf@iznogoud.viz> <83zjamuvgf.fsf@gnu.org> <85egry464g.fsf@iznogoud.viz> <83y4q6us1v.fsf@gnu.org> <85bnn1pvr1.fsf@iznogoud.viz> <83388dudvt.fsf@gnu.org> <85vbl8nce4.fsf@iznogoud.viz> <83tx0suajy.fsf@gnu.org> <85vbl7qa3x.fsf@iznogoud.viz> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1419060504 16885 80.91.229.3 (20 Dec 2014 07:28:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Dec 2014 07:28:24 +0000 (UTC) Cc: 19393@debbugs.gnu.org To: Wolfgang Jenkner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 20 08:28:17 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y2ESW-0005Kk-LB for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Dec 2014 08:28:16 +0100 Original-Received: from localhost ([::1]:33616 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2ESV-0000ba-Ju for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Dec 2014 02:28:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2ESO-0000aS-3O for bug-gnu-emacs@gnu.org; Sat, 20 Dec 2014 02:28:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y2ESI-0002ac-OT for bug-gnu-emacs@gnu.org; Sat, 20 Dec 2014 02:28:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2ESI-0002aY-Kw for bug-gnu-emacs@gnu.org; Sat, 20 Dec 2014 02:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y2ESI-0003rB-7J for bug-gnu-emacs@gnu.org; Sat, 20 Dec 2014 02:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Dec 2014 07:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19393 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19393-submit@debbugs.gnu.org id=B19393.141906046614801 (code B ref 19393); Sat, 20 Dec 2014 07:28:02 +0000 Original-Received: (at 19393) by debbugs.gnu.org; 20 Dec 2014 07:27:46 +0000 Original-Received: from localhost ([127.0.0.1]:52099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y2ES1-0003qe-7N for submit@debbugs.gnu.org; Sat, 20 Dec 2014 02:27:45 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:48364) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y2ERx-0003qT-81 for 19393@debbugs.gnu.org; Sat, 20 Dec 2014 02:27:42 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NGV00E00DXBXL00@a-mtaout20.012.net.il> for 19393@debbugs.gnu.org; Sat, 20 Dec 2014 09:27:39 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NGV00ELYE23P0A0@a-mtaout20.012.net.il>; Sat, 20 Dec 2014 09:27:39 +0200 (IST) In-reply-to: <85vbl7qa3x.fsf@iznogoud.viz> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97591 Archived-At: > From: Wolfgang Jenkner > Cc: 19393@debbugs.gnu.org > Date: Sat, 20 Dec 2014 04:21:54 +0100 > > I have been looking into this with dtrace and what is sure is that > a large amount of data (increasing up to the order of magnitude of the > buffer size) is memcpy'd again and again as a result of mmap_realloc > being called by enlarge_buffer_text. Apparently, the latter is called > for buffer gap handling which is triggered by decode_coding_c_string (or > rather decode_coding_object) in insert-file-contents. So it seems that > the effect on memory of this innocent-looking loop there is enormously > magnified. Yes, that'd be my guess for the reason. > But I have to look at the source more closely (not that I expect to get > any idea how to fix this, though). Since we know the size of the file, we could perhaps compute the new buffer size up front (taking some conservative approximations, if needed), and mmap_realloc it only once.