From owner-freebsd-hackers@freebsd.org Fri Sep 11 14:29:16 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCCD73DC5BD for ; Fri, 11 Sep 2020 14:29:16 +0000 (UTC) (envelope-from shamanthkrishna23@gmail.com) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bnyn76qsrz4QFg; Fri, 11 Sep 2020 14:29:15 +0000 (UTC) (envelope-from shamanthkrishna23@gmail.com) Received: by mail-wr1-x444.google.com with SMTP id c18so11684468wrm.9; Fri, 11 Sep 2020 07:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nJ4oogKTCytQLue7p04OOkrhxevkUeZIw9fMpFWC7OI=; b=rBXtaRThWnlucjOKEINRTi1z8Uorxdfc/colGHTqSRi6Y8iVKhrtQ9IclM9ZeyEMgz 7FbTjdO31UXjnvlVSqekAMJ6j44fHRwjHURHtSuCfsRhzki7Iw3UxQrva9qsTi0ywntA 1X1ThpxS1IWUrl9qA0W4rEK0ywV+ieT1hw5COY71lCzWB0R5Py1Nfcx4TdsJ93sCxnV9 7YS5TzLvHWoAI7k+Nyg0TvW8t55OdxdR1MylSZqj2Wv2CkJs7IFS+jSTzq7lJTwKHbC6 zq5vbIAPu7ko42JnTLdAnNou5pZczJHbCMJAhAI157XH3hHfxVi7bkffa1ENmV5Psn2e Eh9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nJ4oogKTCytQLue7p04OOkrhxevkUeZIw9fMpFWC7OI=; b=J7ZCUS0NzDzPnM4EfmjHnPy+cvPf8gbZ84kFpEwelTkhy42G9RPIMiVrk6Zb7wZ1is vhCI4B9Nw8KzTb0m4PXJI7pUW0YCwPaoipeoi8I2ikDHbjNgetVJJGO7zAfIgFMrUSrW uqANbdrJMXpdWX76s0102dSyzT1ShevD3ZBYQAXUUlLHGVZWXb0uuqn+61ezaNY9TkC6 3jEvmXY7yzjsxEO68thhr66XUGd0k0Ix15zL2xBJvdFIK0hbB1sC39sYbZaDCEOTB7hr lOvOSNVHDq8ZMhU+IWoNdRHN2SmBbF/kfd8irhnVJlAuPtMYNLL34xO3JeezmfpCZF7i o4mQ== X-Gm-Message-State: AOAM533Hw0egwquS3Q6HTCuq47rFTx3IQiqKOm2dCCLSenZehFgbxW6T KGh6lEoD880k17nvDt7kVDDq72Gq925LAMUn8zvoFen+uYM= X-Google-Smtp-Source: ABdhPJzDx1oRoO2md1fu9Z9FhbqTiAfUlj8WXNr1TDjihlzzdMubGoJ7oPJWrm07bTKhms/H9+SU67hUpPQlY+0TqiE= X-Received: by 2002:adf:fd12:: with SMTP id e18mr2472982wrr.96.1599834553928; Fri, 11 Sep 2020 07:29:13 -0700 (PDT) MIME-Version: 1.0 References: <2db16d9822eab8fb536eaf705d6378487c7994ae.camel@freebsd.org> In-Reply-To: From: SHAMANTHA KRISHNA K G Date: Fri, 11 Sep 2020 19:59:01 +0530 Message-ID: Subject: Re: Determing Heap and stack size of running process. To: Ian Lepore Cc: freebsd-hackers@freebsd.org X-Rspamd-Queue-Id: 4Bnyn76qsrz4QFg X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=rBXtaRTh; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of shamanthkrishna23@gmail.com designates 2a00:1450:4864:20::444 as permitted sender) smtp.mailfrom=shamanthkrishna23@gmail.com X-Spamd-Result: default: False [-3.77 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.97)[-0.969]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-0.996]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::444:from]; NEURAL_HAM_SHORT(-0.81)[-0.805]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-hackers]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2020 14:29:16 -0000 Any idea about the fields which have no PRT( I mean no protections flag set --- no read no write no execute) and no flags and with mapping type 'df' ?. Thanks , -Shamantha. On Fri, 11 Sep 2020, 19:31 Ian Lepore, wrote: > On Fri, 2020-09-11 at 19:26 +0530, SHAMANTHA KRISHNA K G wrote: > > Thank you for the heads up, I had tried the output of procstat > > -v also > > ,there also I am not getting any information about heap usage . > > > > Thanks > > -Shamantha > > > > The output does tell you about heap usage, but you have to interpret > the type and flags to figure out which mappings are heap allocations, > and the RES count to figure out how many pages of those mappings are > actually in use (i.e., backed by physical ram). > > Iirc, the mappings with type 'df' and no flags set are the heap > allocations, but I'm not positive of that. Things with the D flag set > are thread stacks. I remember the manpage wasn't all that helpful in > figuring that stuff out last time I needed to know. > > -- Ian > > > > > > > > > > > > On Fri, 11 Sep 2020, 18:59 Ian Lepore, wrote: > > > > > On Fri, 2020-09-11 at 16:36 +0530, SHAMANTHA KRISHNA K G wrote: > > > > Hello All, > > > > I want to know the *size of heap and stack for a running > > > > process* ,how > > > > it can be done, if I* don't *see any* [stack ] *or* [heap] > > > > *in the > > > > output > > > > of */proc/pid/map* and also the platform does not allow > > > > installing > > > > *third party > > > > freebsd utilities like valgrind.* > > > > > > > > Thank you, > > > > -Shamantha > > > > > > > > > > Use procstat(1). For example "procstat -v " will show all the > > > memory mappings for that process. If you need it from within a > > > program > > > you're writing, "man libprocstat" will get you some info on how > > > procstat(1) does its work. > > > > > > -- Ian > > > > > > > > > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to " > > freebsd-hackers-unsubscribe@freebsd.org" > >