From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?q?J=E9r=F4me_Pouiller?= Subject: Re: smap output - unnamed entries and heap Date: Thu, 17 Mar 2011 23:22:48 +0100 Message-ID: <201103172322.49055.jerome@sysmic.org> References: <4D80C47C.80300@draigBrady.com> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Sender: linux-newbie-owner@vger.kernel.org List-ID: Content-Type: Text/Plain; charset="iso-8859-1" To: Aneesh Bhasin Cc: =?iso-8859-1?q?P=E1draig_Brady?= , Randy Dunlap , linux-newbie , linux-kernel On Thursday 17 March 2011 12:46:13 Aneesh Bhasin wrote: [..] > However, as I wrote earlier, there a lot of anonymous memory regions > listed in smap output (with permission rwxp) - and I do not know of > any way in which I could associate these memory mapping to a > particular library.. A few years ago, I had a similar need. I made a small library which ove= rload=20 malloc (and free) and display caller (using backtrace_symbols function)= =2E=20 Next I loaded it using LD_PRELOAD. The main problems are : * it only work for malloced memory (not mmaped memory) * It is difficult to interpred efficiently information provided. Name= of=20 caller may not be sufficient to understand why memory is allocated. -- J=E9r=F4me Pouiller -- To unsubscribe from this list: send the line "unsubscribe linux-newbie"= in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755626Ab1CQW3G (ORCPT ); Thu, 17 Mar 2011 18:29:06 -0400 Received: from sysmic.org ([88.191.45.54]:56858 "EHLO draco.sysmic.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754717Ab1CQW3E convert rfc822-to-8bit (ORCPT ); Thu, 17 Mar 2011 18:29:04 -0400 From: =?iso-8859-1?q?J=E9r=F4me_Pouiller?= To: Aneesh Bhasin Subject: Re: smap output - unnamed entries and heap Date: Thu, 17 Mar 2011 23:22:48 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.32-28-generic; KDE/4.5.3; x86_64; ; ) Cc: =?iso-8859-1?q?P=E1draig_Brady?= , Randy Dunlap , "linux-newbie" , "linux-kernel" References: <4D80C47C.80300@draigBrady.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Message-Id: <201103172322.49055.jerome@sysmic.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 17 March 2011 12:46:13 Aneesh Bhasin wrote: [..] > However, as I wrote earlier, there a lot of anonymous memory regions > listed in smap output (with permission rwxp) - and I do not know of > any way in which I could associate these memory mapping to a > particular library.. A few years ago, I had a similar need. I made a small library which overload malloc (and free) and display caller (using backtrace_symbols function). Next I loaded it using LD_PRELOAD. The main problems are : * it only work for malloced memory (not mmaped memory) * It is difficult to interpred efficiently information provided. Name of caller may not be sufficient to understand why memory is allocated. -- Jérôme Pouiller