From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: warn-maybe-out-of-memory Date: Tue, 15 Jul 2014 08:44:27 +0400 Message-ID: <53C4B1AB.8010402@yandex.ru> References: <83egxtax97.fsf@gnu.org> <83d2ddaw52.fsf@gnu.org> <53BF6B2F.5030701@yandex.ru> <837g3kbd9g.fsf@gnu.org> <53BFA3BB.6090709@yandex.ru> <8361j4b744.fsf@gnu.org> <53BFB1C3.9020202@yandex.ru> <5kpphafqd9.fsf@fencepost.gnu.org> <53C22ED8.5050206@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1405399505 11913 80.91.229.3 (15 Jul 2014 04:45:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jul 2014 04:45:05 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 15 06:44:59 2014 Return-path: Envelope-to: ged-emacs-devel@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 1X6ubq-0000mf-Vb for ged-emacs-devel@m.gmane.org; Tue, 15 Jul 2014 06:44:59 +0200 Original-Received: from localhost ([::1]:32991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6ubq-0004Zr-EC for ged-emacs-devel@m.gmane.org; Tue, 15 Jul 2014 00:44:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6ubh-0004ZK-Pg for emacs-devel@gnu.org; Tue, 15 Jul 2014 00:44:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X6uba-0001ye-Ky for emacs-devel@gnu.org; Tue, 15 Jul 2014 00:44:49 -0400 Original-Received: from forward3l.mail.yandex.net ([84.201.143.136]:57414) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6ubT-0001s7-40; Tue, 15 Jul 2014 00:44:35 -0400 Original-Received: from smtp4h.mail.yandex.net (smtp4h.mail.yandex.net [84.201.186.21]) by forward3l.mail.yandex.net (Yandex) with ESMTP id 2959115012B4; Tue, 15 Jul 2014 08:44:32 +0400 (MSK) Original-Received: from smtp4h.mail.yandex.net (localhost [127.0.0.1]) by smtp4h.mail.yandex.net (Yandex) with ESMTP id 454DA2C49B4; Tue, 15 Jul 2014 08:44:31 +0400 (MSK) Original-Received: from 201.gprs.mts.ru (201.gprs.mts.ru [213.87.132.201]) by smtp4h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id uYnOrSoDZj-iU687rPX; Tue, 15 Jul 2014 08:44:30 +0400 (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client certificate not present) X-Yandex-Uniq: 43c7e9a7-9b23-4c45-9762-74c920366941 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1405399470; bh=TbHjblwoN6Yi3BUPle4sAPEX5aT019QazXJnsY1cmRw=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=SL/GYnb3nLOO8RYEQz3lvSq2cJQbRt8+FKvG+O5IVYrzEeNeuE4UT8tfX0zzULmKa Oh/ZCc9H1niQ+4UghDv5z1FieADyKPtvyD0dZ0kdQBijGCk7GXVGLn89A6rf4xlGGZ 8hyUYmiQcrMMEr49LACI/+6XZmtyNpUEwGiZh2kY= Authentication-Results: smtp4h.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 84.201.143.136 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173032 Archived-At: On 07/15/2014 07:45 AM, Stefan Monnier wrote: > Freeing space from the cache is a trivial action. AFAICS on Linux, this is not true - in my tests, huge allocations may be 20% slower when the kernel should reclaim cache space first. This may be even slower if an OS has to increase swap space (according to Eli, this may happen on MS-Windows). > The OS wants to keep as much stuff in the cache as it can, thus > minimizing the "free" space, since "free" here basically means "wasted". This depends on usage patterns. If you interleave I/O and relatively large allocations, it's fairly unreasonable to fill almost all memory with cached data just to throw it away very soon. > If your "free" includes "free in RAM + free in swap" then it's > marginally more useful ("free in RAM" will usually be close to 0, > whereas "free in swap" should usually be fairly large), but I still > can't think of a frequent enough configuration and situation where this > would be useful enough to justify wasting code on it. This is not expected to be frequent. Dmitry