From owner-freebsd-hackers@freebsd.org Fri Sep 11 14:01:52 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 22A5E3DB7A1 for ; Fri, 11 Sep 2020 14:01:52 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5a.ore.mailhop.org (outbound5a.ore.mailhop.org [44.233.67.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bny9W4hVxz4Ndb for ; Fri, 11 Sep 2020 14:01:51 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1599832904; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=eHAMKDY4yW8hqp87/uiYcXPosf7eaQoTwaSZvkXkJENt2/rhNhzg9EjfRg0SivLRgpmL/ncK+x8MP uxrPtgGLX/MQw31PlQmPNSRAHisoXGdPPkA9gKjgAWvrRhXdW1/BXODyV+0gE/TmS1sqxRgcstMHMA 13kwfoGg+opOF3Lf4VO80uvGIGh1m3lFqGnGmRdXkDEvpxt9WrTBM88eMPqfcsOCCY/ZiSbDxGb7Zh Ta9rcykGL8ZNVW4k/fUoXHP2ublXugvHO0/WsXbSjFu1wh3dZ2rfb5pBRn+BzHl6npJ/e+1uUSq5QU V8j85mX+SACHPDE2ZRZjMLxiSk3FaKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=7qfUH10LZUk80WtFgny4vR80CnOJ36uaDgulyey02xg=; b=WZSbnMTkEvwv82ZJZQhpWGpalKkN9ukO/ApYUx3eUPpng+QI/sW1P8ywFxakqO0tjiyTA8s5EpEDz fuXKN0x1mexrKxherhGRB84ia7NbIispVYdsjlyR4OINVVqPQfDGjhKbTk9II1gUOAmirt1CCOL690 o99oWjGYpy2QZ/Qc7lbuyxZ2JcDNcSpCf88UOl4VX/y6cNe5EEcBQ965yK/lVP3ttYZesN2mW8NGXk 2TjJC4jbEidqbTeWzFYUSJgLgMxbYiKgt5MLYKWNrhD3JRJRsuNzdkrJCg5U7OIu8aQsIaZPzbv8QU mzaIhy/aMG+0VSHJIw/USPQeBL8tf0A== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=7qfUH10LZUk80WtFgny4vR80CnOJ36uaDgulyey02xg=; b=qleYk0krvNRYeq0hcwEqUGGhPt6g9nIBWaPLx8F4OclsnYauuTSYKL0NlV3axZUDAMUcuZJrU2yGc t4eSkE4AN9UravHRb5x6QtfjyJmV+izrNAdhEJy5cAypZkD8MPqnbCHntsNLDOj9emXkms7MAahhrf XVHrNsstknY3AxRMvsY7r1Ov8xWa0oVQ1kd37ynsi8nn1wAtrIkiV+ZGBIdsr1RaNcONThtPn/8jOE 7HYsl2Y0blGas5tJ4Hngp/t8xmcjqksZDsM54W3cNhSTqkHDcaZiPjBgrxvzHHzKF+V0LwHpPcL2z9 9f3AFgqghj1CyQbqucCZUvYlgQT4efg== X-MHO-RoutePath: aGlwcGll X-MHO-User: 51a8dc71-f437-11ea-8b38-614106969e8d X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 51a8dc71-f437-11ea-8b38-614106969e8d; Fri, 11 Sep 2020 14:01:42 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 08BE1fU0080958; Fri, 11 Sep 2020 08:01:41 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: Determing Heap and stack size of running process. From: Ian Lepore To: SHAMANTHA KRISHNA K G Cc: freebsd-hackers@freebsd.org Date: Fri, 11 Sep 2020 08:01:41 -0600 In-Reply-To: References: <2db16d9822eab8fb536eaf705d6378487c7994ae.camel@freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bny9W4hVxz4Ndb X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US] 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:01:52 -0000 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"