Jonathan Toomim [ARCHIVE] on Nostr: 📅 Original date posted:2015-10-21 📝 Original message:The method I was using was ...
📅 Original date posted:2015-10-21
📝 Original message:The method I was using was essentially
grep VmRSS /proc/$pid/status
Comparing these two methods, I get
Your method (PSS):
2408313
My method (RSS):
VmRSS: 2410396 kB
On Oct 21, 2015, at 12:29 AM, Tom Zander <tomz at freedommail.ch> wrote:
> On Tuesday 20 Oct 2015 20:01:16 Jonathan Toomim wrote:
> Please make sure you measure your memory usage correctly on Linux, it is
> notoriously easy to get misleading info from tools like top.
>
> I use this one on Linux.
>
> $cat ~/bin/showmemusage
> #!/bin/sh
> if test -z "$1"; then
> echo "need a pid"
> exit
> fi
>
> mem=`echo 0 $(cat /proc/$1/smaps | grep Pss | awk '{print $2}' | \
> sed 's#^#+#' ) | bc`
> echo "$mem KB"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <
http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20151021/b272a7de/attachment.sig>
Published at
2023-06-07 17:43:22Event JSON
{
"id": "52837a9db6d8de4acc06f17189cb8bc8eab64162eee89a43111234f0dec0d4dd",
"pubkey": "0ff56c09ef879c89ea04bfa2d5f5e0d96000ed6eaf5ac38e7b538a9d92767569",
"created_at": 1686159802,
"kind": 1,
"tags": [
[
"e",
"257c60cbd2c94bcbc1af242f96780d9665ec0aa19ec5454bed0371ff096c7c39",
"",
"root"
],
[
"e",
"37413ececdce37f69b01f53bff39a6cc15db9152d9b669746e1d3f4ac4558461",
"",
"reply"
],
[
"p",
"dcb947d818dbfd7cf0baf26c0d5eb606b5a32336c5483fb53e05146315833ca7"
]
],
"content": "📅 Original date posted:2015-10-21\n📝 Original message:The method I was using was essentially\n\n\tgrep VmRSS /proc/$pid/status\n\nComparing these two methods, I get\n\nYour method (PSS):\n\t2408313\nMy method (RSS):\n\tVmRSS:\t 2410396 kB\n\nOn Oct 21, 2015, at 12:29 AM, Tom Zander \u003ctomz at freedommail.ch\u003e wrote:\n\n\u003e On Tuesday 20 Oct 2015 20:01:16 Jonathan Toomim wrote:\n\u003e Please make sure you measure your memory usage correctly on Linux, it is\n\u003e notoriously easy to get misleading info from tools like top.\n\u003e \n\u003e I use this one on Linux.\n\u003e \n\u003e $cat ~/bin/showmemusage\n\u003e #!/bin/sh\n\u003e if test -z \"$1\"; then\n\u003e echo \"need a pid\"\n\u003e exit\n\u003e fi\n\u003e \n\u003e mem=`echo 0 $(cat /proc/$1/smaps | grep Pss | awk '{print $2}' | \\\n\u003e sed 's#^#+#' ) | bc`\n\u003e echo \"$mem KB\"\n\n\n-------------- next part --------------\nA non-text attachment was scrubbed...\nName: signature.asc\nType: application/pgp-signature\nSize: 496 bytes\nDesc: Message signed with OpenPGP using GPGMail\nURL: \u003chttp://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20151021/b272a7de/attachment.sig\u003e",
"sig": "c1594414aadbf8d01e79442e68ce48124783b483b8c2c3748310529bc32c203951ab32a854ca61a627db74d7c65012151bafdd71a9b2db5e6cf9d831010c7fd6"
}