From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25564 invoked by alias); 3 Jul 2009 14:30:57 -0000 Received: (qmail 25545 invoked by uid 22791); 3 Jul 2009 14:30:54 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Jul 2009 14:30:48 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id 3D50A151B0CB for ; Fri, 3 Jul 2009 15:30:46 +0100 (BST) Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H8rX23Rr69L3; Fri, 3 Jul 2009 15:30:44 +0100 (BST) Message-ID: <4A4E1613.6010706@ecoscentric.com> Date: Fri, 03 Jul 2009 14:30:00 -0000 From: Ross Younger User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: eCos Disuss References: <4A4B771F.1060804@intefo.ch> <4A4BA566.7030705@ecoscentric.com> In-Reply-To: <4A4BA566.7030705@ecoscentric.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] YAFFS memory usage X-SW-Source: 2009-07/txt/msg00020.txt.bz2 Earlier this week, I wrote: > I should raise a flag about YAFFS memory usage. [...] > I am in the process of composing a post to the YAFFS mailing list raising > this and will see what the folks there say. http://lists.aleph1.co.uk/lurker/message/20090701.190059.23524635.en.html is the response I got from Charles Manning, though the aleph1 site is down as I type this. In short, my measured figures[*] are in line with expectations, and the calculations I had found on yaffs.net are out of date; Charles has provided a revised calculation which I am working into my package's docs. [*] 10000 files x 10240 bytes consumed a little over 1.6M of heap The two main consumers of RAM at runtime are: 1. Every object in the fs (files, directories) takes 120 bytes. 2. Every NAND page used by every file requires a Tnode entry. * Entries are allocated to file structs in groups of 16 at a time. * The size of a _single_ Tnode entry is the number of _bits_ required to number all the pages in the NAND partition YAFFS is using, numbered from _one_; this is rounded up to a multiple of 2, and has an absolute minimum of sixteen bits. This represents the bulk of heap usage for all but the simplest filesystems. The device struct itself, internal page cacheing, and the internal Tnode tree nodes push consumption out a little further, not to mention the heap's own overheads. Ross -- Embedded Software Engineer, eCosCentric Limited. Barnwell House, Barnwell Drive, Cambridge CB5 8UU, UK. Registered in England no. 4422071. www.ecoscentric.com -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss