Page 1 of 1

Just a useful memory util I'd like to share.

Posted: 2020-02-21 21:53
by Deb-fan
Well accurately gauging memory in use can be a headache. Sometimes different utils like to show slightly different stats. When someone is as fanatical about checking this type of thing as I am, this shall not do! Using the "free -m" command is handy, installing and using ps_mem handier still but introducing the smem package. Thing shows uss/pss and rss with (oops typo)pss supposedly being the gold standard showing what's being used memory-wise. Am fond of this cmd here, "smem -t -k" but "smem -h" gives help info for what's available in it.

"apt search smem" and/or "apt show smem" It's fun to dork with, Enjoy. :)

Re: Just a useful memory util I'd like to share.

Posted: 2020-02-21 23:39
by Deb-fan
Kind of odd the guy posting about something turns around and asks about it but hey, plenty of tech savvy types to ask here. What do you guys think of smem vs ps_mem in terms of accuracy ? Personally lean towards smem due to the wealth of options. Thing even reports it's own process memory stats in the output. Kinda would like to see that stripped out, looks like is added to the pss total too so would have to subtract that i think but am not adding up the whole column to see. :) Other junk smem reports individual processes whereas ps_mem just combines the things Ie xterm(2) with it means 2 xterm processes running. So whatcha think fellas which is more accurate? Two python solutions, just very slightly different stats, arghhhh. Still appears to be about as good as a nixers gonna get in this deal.

Also by the way folks can also minus off the terminal process from your total. If you were wanting to see what the system is using and running the cmd in xterm, memory used/shown for that xterm process don't count. Still find it oddball but hey thorough that smem reports it's own processes memory used.

Re: Just a useful memory util I'd like to share.

Posted: 2020-03-08 04:04
by Deb-fan
Random update:

Come to much prefer smem, think it's more accurate and versatile over ps_mem. Another thing I've noticed here, recently compiled a couple newer Kernel's v 5.4's as result the output of ps_mem went wonky, whereas smem and the "free -m" cmds-etc had no problems. Likely only means I'd have to reinstall ps_mem to get it up to speed with the system changes, working right again. Going to just uninstall it instead and rely on smem though. :)

Re: Just a useful memory util I'd like to share.

Posted: 2020-03-09 22:38
by Deb-fan
More randomness about this, smem vs ps_mem. Not only is smem more accurate, it's a full binary app and managed by the OS's pkg management tools, apt/itude etc, whereas ps_mem is just a scripty thing. Also doesn't need it (neither do) though do tend to run smem with sudo privs. Only added it to a file kept in /etc/sudoers.d by adding /usr/bin/smem let's it run as sudo w/o passwd required. Also added a bash alias to my .bash_aliases file in /home. Just mem="sudo smem -tk" just type mem in terminals to see current system pss memory useage. Cool stuff. :)