From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15820 invoked by alias); 19 Jan 2015 20:08:04 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 15807 invoked by uid 89); 19 Jan 2015 20:08:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 19 Jan 2015 20:08:02 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0JK7ubC017441 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 19 Jan 2015 15:07:56 -0500 Received: from fche.csb (vpn-227-105.phx2.redhat.com [10.3.227.105]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0JK7t7v010981; Mon, 19 Jan 2015 15:07:56 -0500 Received: by fche.csb (Postfix, from userid 2569) id 06D355865E; Mon, 19 Jan 2015 15:07:44 -0500 (EST) To: Sergey Klyaus Cc: systemtap Subject: Re: Excessive memory usage by associative arrays References: From: fche@redhat.com (Frank Ch. Eigler) Date: Mon, 19 Jan 2015 20:08:00 -0000 In-Reply-To: (Sergey Klyaus's message of "Mon, 19 Jan 2015 20:58:17 +0400") Message-ID: User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2015-q1/txt/msg00036.txt.bz2 Sergey Klyaus writes: > [...] > - Each string is stored statically and MAP_STRING_LENGTH is 256 (i > have 2 keys so its 256) > - Plus statistics data gives us 1088 bytes per entry > - SystemTap initializes map on per-cpu basis and do it with > for_each_possible_cpu() (128 in my case) Yes, unfortunately all those factors multiply. You can control MAXMAPENTRIES and MAXSTRINGLEN directly via -D options or other ways. How many CPUs does your machine actually have? See also https://sourceware.org/systemtap/wiki/TipExhaustedResourceErrors > Of course, I may reduce MAXMAPENTRIES, but I think there is > something wrong with such greedy allocation... Its purpose is to ensure that no dynamic memory allocation occurs during runtime, so is a safety measure. > For the record, similiar DTrace script works perfectly (after I > removed leak of records :) ). Understood, though their situation is much simpler, and that toy script can be made to work on stap in many ways. - FChE