Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: vallor Newsgroups: misc.phone.mobile.iphone,comp.os.linux.advocacy Subject: Re: =?UTF-8?B?8J+Ps++4j+KAjfCfjIhBcHBsZQ==?= requires too much money and sacrifice of =?UTF-8?B?Y29udHJvbPCfj7PvuI/igI3wn4yI?= Date: 6 Apr 2025 04:31:07 GMT Lines: 41 Message-ID: References: <0a34uj9pf5r7f4kneahsc4v6qgfq1684mi@4ax.com> <7j64uj172e6b9tat3v1n7gla57mml2ag0j@4ax.com> <4n33vjlr9kj9922n8ni24tuignun80b0ub@4ax.com> <=3D?U=3D?UTF-8?Q?T?=3DF-8?Q?=3DF0=3D9F=3D8C=3DBA?=3DSFYYKqFOJPpizw0@54.182.186.98=3D?U=3D?UTF-8?Q?T?=3DF-8?Q?=3DF0=3D9F=3D8C=3DBA?=3D> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net wmfAhhDGMNm9yg/LlIetUgvYO60mlzudWl2MLqnvmuKDyC7ZIM Cancel-Lock: sha1:T+PU8OXiUj734kFnOM12I95b1e8= sha256:ffRHr9eHPUe/nae7z2V3P+RQ4QUZf8jtmE9CswzBzBw= X-Face: +McU)#<-H?9lTb(Th!zR`EpVrp<0)1p5CmPu.kOscy8LRp_\u`:tW;dxPo./(fCl CaKku`)]}.V/"6rISCIDP` User-Agent: Pan/0.162 (Hmm4; f7d29671; Linux-6.14.0) Xref: csiph.com misc.phone.mobile.iphone:194116 comp.os.linux.advocacy:688703 On 6 Apr 2025 03:35:26 GMT, vallor wrote in : > Alas, Macs don't have /proc. > > Would be nice if they did, though. This works on a Mac: #!/usr/bin/perl open(PS,'ps -avmxww|') || die; $header = ; while() { $line = $_; chomp($line); $line =~ s/^\s+//; ($pid,$stat,$t,$sl,$re,$pagein,$vsz,$rss,$rest) = split(/\s+/,$line,9); $proc{$pid}=$line; $rss{$pid}=$rss; $total_rss+=$rss; } @sorted = sort {$rss{$a} <=> $rss{$b}} (keys %rss); foreach $pid (@sorted) { print $proc{$pid},"\n"; } printf ("Total RSS: %d pages (%d bytes)\n",$total_rss,$total_rss*1024); exit 0; -- -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti OS: Linux 6.14.0 Release: Mint 22.1 Mem: 258G "An unbreakable toy is useful for breaking other toys."