From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10949 invoked by alias); 31 Jul 2017 22:11:54 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 10937 invoked by uid 89); 31 Jul 2017 22:11:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=understandable, Lindsay, lindsay, Hx-languages-length:1358 X-HELO: mail-io0-f195.google.com Received: from mail-io0-f195.google.com (HELO mail-io0-f195.google.com) (209.85.223.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 31 Jul 2017 22:11:52 +0000 Received: by mail-io0-f195.google.com with SMTP id f1so246393ioj.2 for ; Mon, 31 Jul 2017 15:11:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=WEpW2fCdmYkZ/9IjQxPBPoT3u4/sz65/Evm74trjJqM=; b=nMyEyYNEwRvLiN8949vUBpdv98YykzGNaEpZUlSDehq7Tg5xIpZ5ImoyEJp6itar6n 5Tdhyl/8oLc0rXCkMyZ1KZ6BQT85mNnkNCQzAtFEoPeDk5+F0pK3UgRjRIybUtejRGt7 vMP7jhwjaE/qxrrz6G6YPcGTFNH/npNMg1DCMBpuL5e88N+7079RBvCP1VLhnG7UGJJ0 kpHlDRLQqqryVm/obtylCgaudlZDHsjHlwE8kaPlJmedZRPJ9Sya6Iax0ebxzDn2AHSM wr91a8j9vOUUMjqS9C+3mO0Lu0mOtiC+smhXEj2XiVm1SjQHD9CfseJK46HA3hk+SZCa D6tA== X-Gm-Message-State: AIVw112+NLoGTYIv7qniLUfvi0cTIrrQpSSwAPM8nvRu5EKop6NFxnS6 s7Jk+pKzrB2fe7K/tnw= X-Received: by 10.107.195.202 with SMTP id t193mr19694862iof.248.1501539110037; Mon, 31 Jul 2017 15:11:50 -0700 (PDT) Received: from [128.174.163.204] ([128.174.163.204]) by smtp.gmail.com with ESMTPSA id z80sm5970559itc.10.2017.07.31.15.11.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jul 2017 15:11:48 -0700 (PDT) Subject: Re: Large memory usage by gdb To: Philippe Waroquiers Cc: gdb@sourceware.org References: <8d511930-9914-9aef-363f-2fff37dfc6a8@gmail.com> <1501014538.2145.22.camel@skynet.be> From: Alex Lindsay Message-ID: <832a7365-8905-a49e-b97d-2d8a3520c747@gmail.com> Date: Mon, 31 Jul 2017 22:11:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1501014538.2145.22.camel@skynet.be> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg00051.txt.bz2 Philippe, Is memcheck a better tool to use here compared to massif? Alex On 07/25/2017 03:28 PM, Philippe Waroquiers wrote: > Run gdb under Valgrind, and make some heap profiling dump at regular > interval, (e.g. after each run). > > With valgrind 3.12 or before, you can do a leak report to show > the delta (increase or decrease) compared to the previous leak search, > including the reachable blocks. So, you will be able to see what > increases the memory. > > If you compile the latest Valgrind (3.13), you can e.g. use memcheck > and produce heap profiling reports readable with kcachegrind. > > You will need a gdb compiled with debug or install the debug info > of gdb to have understandable stack traces. > > Philippe > > On Tue, 2017-07-25 at 15:20 -0500, Alex Lindsay wrote: >> My OS is Ubuntu 17.04. Using both gdb 7.12 and 8.0, I experience large >> memory usage when debugging my executable. As I add breakpoints and run >> the executable multiple times in a single session, memory usage grows >> continuously, regularly hitting 10s of GBs. I don't recall experiencing >> this issue with earlier Ubuntu versions (and also likely earlier >> versions of gdb). When I debug the same executable with `lldb`, memory >> usage is pretty much constant at around 2 GB. Does anyone have any >> suggestions? >> >> Alex >