The officially official Devuan Forum!

You are not logged in.

#1 2019-06-26 04:36:43

macondo
Member
From: Central America
Registered: 2017-06-11
Posts: 52  

ps_mem.py

2bb8e61262113044.jpg


Desktop Dual Core 8 GB RAM - Devuan Ceres - Slackware Current - Grub - JWM
“Just because you're paranoid doesn't mean they aren't after you.” ― Joseph Heller, Catch-22

Offline

#2 2019-06-26 09:53:08

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,486  

Re: ps_mem.py

What's in the black box? I can't see your image. All I get are ads when I allow javascript.

Offline

#3 2019-06-26 12:54:01

macondo
Member
From: Central America
Registered: 2017-06-11
Posts: 52  

Re: ps_mem.py

I gotta replace my monitor, the screesnshot waw ps_mem showing how much memory I use.


Desktop Dual Core 8 GB RAM - Devuan Ceres - Slackware Current - Grub - JWM
“Just because you're paranoid doesn't mean they aren't after you.” ― Joseph Heller, Catch-22

Offline

#4 2019-06-26 17:21:24

Ogis1975
Member
Registered: 2017-04-21
Posts: 307  
Website

Re: ps_mem.py

But why use super-user rights to see how much RAM is used? I never understood the benefits of this program (ps_mem).


What economists call over-production is but a production that is above the purchasing power of the worker, who is reduced to poverty by capital and state.
            ----+- Peter Kropotkin -+----

Offline

#5 2019-06-26 17:52:34

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: ps_mem.py

fsmithred wrote:

I can't see your image. All I get are ads when I allow javascript.

Click on "continue to image" to see the image smile

Ogis1975 wrote:

I never understood the benefits of this program

It displays the memory used for each process running, which can be very useful.

@OP: why not just post the text rather than an image of text?

Like this:

 Private  +   Shared  =  RAM used       Program

216.0 KiB +  71.5 KiB = 287.5 KiB       startx
284.0 KiB + 117.5 KiB = 401.5 KiB       init
312.0 KiB + 147.5 KiB = 459.5 KiB       cron
260.0 KiB + 222.5 KiB = 482.5 KiB       xinit
284.0 KiB + 240.5 KiB = 524.5 KiB       slstatus
364.0 KiB + 186.5 KiB = 550.5 KiB       dbus-launch
616.0 KiB + 134.5 KiB = 750.5 KiB       loksh
580.0 KiB + 671.5 KiB =   1.2 MiB       getty (5)
600.0 KiB + 698.0 KiB =   1.3 MiB       dbus-daemon (2)
  1.0 MiB + 339.5 KiB =   1.4 MiB       login
  1.1 MiB + 433.5 KiB =   1.5 MiB       sudo
  1.7 MiB + 107.5 KiB =   1.8 MiB       elogind-daemon
  1.7 MiB + 186.5 KiB =   1.9 MiB       rsyslogd
  1.3 MiB +   1.3 MiB =   2.6 MiB       dwm
  2.8 MiB + 216.5 KiB =   3.0 MiB       udevd
  3.7 MiB +   1.4 MiB =   5.1 MiB       xterm
 42.5 MiB + 816.5 KiB =  43.3 MiB       Xorg
---------------------------------
                         66.5 MiB
=================================

I win big_smile


Brianna Ghey — Rest In Power

Offline

#6 2019-06-26 19:23:29

macondo
Member
From: Central America
Registered: 2017-06-11
Posts: 52  

Re: ps_mem.py

HOS: you the MAN! Never occurred to me to paste it. Dementia is creeping up. (72)
Ogi: you're right, I should use it as user.

Last edited by macondo (2019-06-26 19:24:10)


Desktop Dual Core 8 GB RAM - Devuan Ceres - Slackware Current - Grub - JWM
“Just because you're paranoid doesn't mean they aren't after you.” ― Joseph Heller, Catch-22

Offline

#7 2019-06-26 23:11:45

macondo
Member
From: Central America
Registered: 2017-06-11
Posts: 52  

Re: ps_mem.py

It seems you're supposed to launch it as root (sudo):

bobo@foo:~$ ps_mem
Sorry, root permission required, or specify pids with -p
bobo@foo:~$ sudo ps_mem
 Private  +   Shared  =  RAM used	Program

128.0 KiB +  72.5 KiB = 200.5 KiB	gnome-pty-helper
188.0 KiB +  43.5 KiB = 231.5 KiB	startx
236.0 KiB +  77.5 KiB = 313.5 KiB	init
200.0 KiB + 143.0 KiB = 343.0 KiB	xinit
236.0 KiB + 155.5 KiB = 391.5 KiB	unclutter
272.0 KiB + 150.5 KiB = 422.5 KiB	cron
340.0 KiB + 157.5 KiB = 497.5 KiB	irqbalance
392.0 KiB + 179.0 KiB = 571.0 KiB	dbus-launch [updated]
868.0 KiB + 167.5 KiB =   1.0 MiB	elogind
616.0 KiB + 587.0 KiB =   1.2 MiB	getty (5)
900.0 KiB + 340.0 KiB =   1.2 MiB	login
  1.2 MiB +  88.0 KiB =   1.3 MiB	udevd
968.0 KiB + 372.0 KiB =   1.3 MiB	sudo
  1.4 MiB +  92.5 KiB =   1.4 MiB	rsyslogd
  1.4 MiB +  63.5 KiB =   1.5 MiB	dhclient
820.0 KiB +   1.0 MiB =   1.8 MiB	dbus-daemon [updated] (2)
  1.1 MiB +   1.4 MiB =   2.6 MiB	bash (3)
  3.0 MiB + 869.0 KiB =   3.8 MiB	icewm
  6.3 MiB +   1.6 MiB =   7.9 MiB	lxterminal
 19.8 MiB +   3.7 MiB =  23.5 MiB	Xorg
426.3 MiB +  92.9 MiB = 519.2 MiB	firefox-esr (6)
---------------------------------
                        570.6 MiB

Desktop Dual Core 8 GB RAM - Devuan Ceres - Slackware Current - Grub - JWM
“Just because you're paranoid doesn't mean they aren't after you.” ― Joseph Heller, Catch-22

Offline

#8 2019-06-27 01:59:11

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,486  

Re: ps_mem.py

Head_on_a_Stick wrote:
fsmithred wrote:

I can't see your image. All I get are ads when I allow javascript.

Click on "continue to image" to see the image smile

Yes, I tried that before and after allowing javascript. It didn't work. I can never see twitter, either. Just a big blue bird. Maybe my computer is trying to protect me from what's there.

                         66.5 MiB
=================================

I win big_smile

Whoa. To paraphrase the late rickh: Are you sure you're running devuan? That looks more like antix.

Offline

#9 2019-06-27 07:38:05

Nili
Member
From: $HOME/♫♪
Registered: 2016-12-01
Posts: 230  
Website

Re: ps_mem.py

Devuan 1 (Jessie) i686

Mem: 217MB / 2GB

X @ 6.7MB (striped to very minimum) for an old 2007 hardware.
I have in use for 12 years and still is strong for nowdays tasks.

After starting startx, fake busy...

█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▓▒░█▒░

   hello nili, i'm devuan
 
       distro Devuan GNU/Linux
          upt 11 min
     packages 445
         gfon Ubuntu 12
           wm openbox-session
 
    cpu 2%    ━────────────── 
    vol 28%   ━━━━━────────── 
    ram 7%    ━━───────────── 
    tmp 54°c  ━━━━━━━━━────── 

#! nili ~ $ 
#! nili ~ $ pstree
init─┬─hddtemp
     ├─login───startx───xinit─┬─Xorg
     │                        └─openbox─┬─compton
     │                                  ├─conky───9*[{conky}]
     │                                  ├─deadbeef-gtkui─┬─{deadbeef-alsa}
     │                                  │                ├─{deadbeef-artwor}
     │                                  │                ├─{deadbeef-gtkui-}
     │                                  │                ├─{deadbeef-hotkey}
     │                                  │                ├─3*[{deadbeef-main}]
     │                                  │                ├─{deadbeef-server}
     │                                  │                └─{deadbeef-stream}
     │                                  ├─obconf
     │                                  ├─obmenu
     │                                  ├─spacefm
     │                                  ├─tint2
     │                                  ├─x-terminal-emul───bash───pstree
     │                                  └─x-www-browser─┬─{Cache I/O}
     │                                                  ├─{Cache2 I/O}
     │                                                  ├─{Compositor}
     │                                                  ├─{DNS Resolver #1}
     │                                                  ├─{DOM Worker}
     │                                                  ├─3*[{DataStorage}]
     │                                                  ├─{Gecko_IOThread}
     │                                                  ├─{HTML5 Parser}
     │                                                  ├─{Hang Monitor}
     │                                                  ├─{IPDL Background}
     │                                                  ├─{ImageBridgeChil}
     │                                                  ├─{ImageIO}
     │                                                  ├─{ImgDecoder #1}
     │                                                  ├─{ImgDecoder #2}
     │                                                  ├─6*[{JS Helper}]
     │                                                  ├─{JS Watchdog}
     │                                                  ├─{Link Monitor}
     │                                                  ├─{Proxy R~olution}
     │                                                  ├─{Socket Thread}
     │                                                  ├─{SoftwareVsyncTh}
     │                                                  ├─{Timer}
     │                                                  ├─{gmain}
     │                                                  ├─{localStorage DB}
     │                                                  ├─{mozStorage #1}
     │                                                  ├─{mozStorage #2}
     │                                                  ├─{mozStorage #3}
     │                                                  ├─{mozStorage #4}
     │                                                  └─{mozStorage #5}
     └─udevd

#! nili ~ $ psmem
Password: 
 Private  +   Shared  =  RAM used	Program

176.0 KiB +  75.5 KiB = 251.5 KiB	startx
192.0 KiB + 106.0 KiB = 298.0 KiB	init
172.0 KiB + 145.5 KiB = 317.5 KiB	xinit
372.0 KiB +  71.5 KiB = 443.5 KiB	hddtemp
380.0 KiB + 357.5 KiB = 737.5 KiB	su
516.0 KiB + 315.5 KiB = 831.5 KiB	login
768.0 KiB + 523.0 KiB =   1.3 MiB	compton
  1.3 MiB + 152.5 KiB =   1.4 MiB	udevd
  1.3 MiB + 221.0 KiB =   1.5 MiB	bash
  1.2 MiB + 558.0 KiB =   1.8 MiB	conky
  1.9 MiB +   2.1 MiB =   4.0 MiB	tint2
  6.6 MiB +   1.2 MiB =   7.8 MiB	x-terminal-emulator
  5.1 MiB +   3.4 MiB =   8.5 MiB	spacefm
  6.1 MiB +   2.8 MiB =   8.9 MiB	openbox
  5.5 MiB +   6.0 MiB =  11.5 MiB	obconf
  7.8 MiB +   4.9 MiB =  12.7 MiB	Xorg
 12.1 MiB +   3.9 MiB =  15.9 MiB	obmenu
 14.8 MiB +   4.5 MiB =  19.3 MiB	deadbeef-gtkui
116.5 MiB +   3.2 MiB = 119.7 MiB	x-www-browser
---------------------------------
                        217.2 MiB
=================================
#! nili ~ $ 

Tumbleweed - KDE Plasma (Wayland) - Breeze (LeafDark) [Qt]
♪Mahara★Japaaan!

Offline

#10 2019-06-27 15:11:16

Ogis1975
Member
Registered: 2017-04-21
Posts: 307  
Website

Re: ps_mem.py

macondo wrote:

Ogi: you're right, I should use it as user.

Hi! I read the official documentation. As I understood, you need to use super-user rights. That's what this program is designed for...


What economists call over-production is but a production that is above the purchasing power of the worker, who is reduced to poverty by capital and state.
            ----+- Peter Kropotkin -+----

Offline

#11 2019-06-27 17:29:15

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: ps_mem.py

fsmithred wrote:

Are you sure you're running devuan?

Oh yes, that's Devuan — I used the netinstall ASCII image then upgraded to beowulf and installed my simple-desktop package and switched to OpenRC.

It's running under 64-bit QEMU/KVM with 4GiB assigned and it runs very well indeed.

devuan:~$ pstree
init─┬─cron
     ├─2*[dbus-daemon]
     ├─dbus-launch
     ├─elogind-daemon
     ├─5*[getty]
     ├─login───startx───xinit─┬─Xorg───{Xorg}
     │                        └─dwm─┬─slstatus
     │                              └─xterm───loksh───pstree
     ├─rsyslogd───3*[{rsyslogd}]
     └─udevd
devuan:~$
fsmithred wrote:

That looks more like antix.

antiX is awesome but I would have to spend ages gutting it like a fish to get the desktop I want but Devuan lets me work my way up from scratch, which is much quicker and simpler smile


Brianna Ghey — Rest In Power

Offline

#12 2019-06-28 13:07:31

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 211  

Re: ps_mem.py

Devuan lets me work my way up from scratch

I hear you on that.  It is my preferred way to build, not desktop install and then removing stuff.

Question, on my desktop, this ps_mem.py works fine.  But on another system I get this error.  Any ideas on what is missing?

$ sudo ps_mem.py
  File "/usr/local/sbin/ps_mem.py", line 448
    "%s: Shared memory is not reporte
                                    ^
SyntaxError: EOL while scanning string literal

The difference between the two systems is that the one that works is a desktop install.  The other is a virtual machine, devuan (ascii) on vultr.

Python is installed:

python is already the newest version (2.7.13-2).

Last edited by nixer (2019-06-28 13:11:13)

Offline

#13 2019-06-28 21:16:27

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: ps_mem.py

nixer wrote:

Any ideas on what is missing?

Looks like vultr isn't exposing shared memory in it's containers but that's just an uninformed guess on my behalf.

Can you see /dev/shm in the output of df -h?


Brianna Ghey — Rest In Power

Offline

#14 2019-06-28 21:44:03

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 211  

Re: ps_mem.py

# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            485M     0  485M   0% /dev
tmpfs           100M  340K  100M   1% /run
/dev/vda1        25G  5.2G   20G  21% /
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           200M     0  200M   0% /run/shm

On the last line I see /run/shm, but no /dev/shm

Offline

#15 2019-06-28 21:47:10

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: ps_mem.py

So you don't have any shared memory in the container then.

Probably a good thing though, at least in respect of security.


Brianna Ghey — Rest In Power

Offline

Board footer