You are not logged in.
Pages: 1
Whenever I start mpd, after a little while I have 3 instances of it. I don't know why. Can someone tell me how this whole thing works for my understanding?
Here's my ps_mem.py and also the pidof mpd
inxs ~ > sudo python ps_mem.py
Password:
Private + Shared = RAM used Program
0.0 KiB + 14.0 KiB = 14.0 KiB udevd
8.0 KiB + 14.5 KiB = 22.5 KiB portmap
4.0 KiB + 23.5 KiB = 27.5 KiB startx
4.0 KiB + 24.0 KiB = 28.0 KiB xinit
4.0 KiB + 28.0 KiB = 32.0 KiB dbus-launch
4.0 KiB + 29.0 KiB = 33.0 KiB hald-addon-acpi
0.0 KiB + 33.0 KiB = 33.0 KiB openbox-session (2)
4.0 KiB + 34.0 KiB = 38.0 KiB famd
4.0 KiB + 39.0 KiB = 43.0 KiB login
4.0 KiB + 47.0 KiB = 51.0 KiB hald-runner
48.0 KiB + 15.0 KiB = 63.0 KiB init
4.0 KiB + 64.0 KiB = 68.0 KiB hald-addon-dell-backlight
20.0 KiB + 65.0 KiB = 85.0 KiB agetty (5)
80.0 KiB + 19.0 KiB = 99.0 KiB crond
60.0 KiB + 42.0 KiB = 102.0 KiB hald-addon-storage
64.0 KiB + 45.0 KiB = 109.0 KiB hald-addon-input
144.0 KiB + 58.5 KiB = 202.5 KiB sshd
364.0 KiB + 21.0 KiB = 385.0 KiB syslog-ng
252.0 KiB + 273.0 KiB = 525.0 KiB dbus-daemon (2)
500.0 KiB + 103.5 KiB = 603.5 KiB conky
592.0 KiB + 98.0 KiB = 690.0 KiB hald
1.1 MiB + 95.0 KiB = 1.2 MiB bash (2)
2.1 MiB + 287.5 KiB = 2.4 MiB openbox
1.8 MiB + 1.0 MiB = 2.8 MiB fbpanel
3.4 MiB + 277.5 KiB = 3.7 MiB urxvt
4.0 MiB + 2.6 MiB = 6.7 MiB mpd (3)
6.3 MiB + 1.3 MiB = 7.6 MiB pidgin
13.9 MiB + 2.6 MiB = 16.5 MiB sonata
23.2 MiB + 1.4 MiB = 24.6 MiB skype
32.3 MiB + 701.5 KiB = 33.0 MiB Xorg
66.5 MiB + 2.0 MiB = 68.6 MiB firefox
---------------------------------
170.3 MiB
=================================
Private + Shared = RAM used Program
inxs ~ > pidof mpd
10550 10549 10548
inxs ~ >
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
That's completely normal for mpd, on both of my machines mpd has three processes. I don't know why's that you could question the developers. However I noticed that if I start killing processes there is only one crucial mpd process. I can kill the other two without killing mpd.
My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...
Offline
Mine only has one
Offline
% ps aux | grep /usr/bin/mpd | wc -l
1
Public Key 0x24685E35 available from any key server you trust.
IRC: ssimon/Nesrecar
Offline
I have 4, lol
Offline
I also have 3. 'ps aux | grep mpd | wc -l' = 4, but that also counts the grep
Offline
I also have 3. 'ps aux | grep mpd | wc -l' = 4, but that also counts the grep
Not everytime, example:
% ps aux | grep /usr/bin/mpd | wc -l
2
% ps aux | grep /usr/bin/mpd | wc -l
1
% ps aux | grep /usr/bin/mpd | wc -l
2
Just count -1 if it adds grep too
Public Key 0x24685E35 available from any key server you trust.
IRC: ssimon/Nesrecar
Offline
I think maybe mpd initially did not use threads but rather multiple processes for concurrency. I think right now they are transitioning towards threads (many threads of execution in one process). Um this is info from quickly reading the mpd wiki a long time ago. I may be totally wrong. But for example, I found this with a "grep fork" in the mpd source in decode.c:
/* decode w/ buffering
* this will fork another process
* child process does decoding
* parent process does playing audio
*/
void decode(void)
{
ob_clear();
dc.error = DECODE_ERROR_NOERROR;
dc.seek = 0;
dc.stop = 0;
dc.start = 1;
do { player_wakeup_decoder(); } while (dc.start);
decodeParent();
}
When I start mpd, it has only one process. After I've issued the "play" command, it has three.
Offline
why not just
ps ax | grep mpd
the suggested
% ps aux | grep /usr/bin/mpd | wc -l
returns on bash
-bash: %: command not found
ps ax | grep mpd | wc -l
gives me 4 but I don't get to see one is the grep and it's of no use to me for killing the process
Last edited by tj (2008-07-30 14:57:10)
Offline
'%' is not a part of the comman.
I have 3 instances too. It does not matter if the mpd is playing or not, they are 3.
Offline
Alright. I am glad everyone has similar number of instances. I thought I was probably instantiating mpd in different places and probably forgot about it.
When I explicitly kill all instances, and then issue the
mpd
command, I have 1 instance according to pidof -- then after some (short) time it becomes 3 instances irrespective of whether I started playing songs or not.
and
ps aux | grep mpd | wc -l
gives me 4
Last edited by Inxsible (2008-07-30 15:48:35)
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
Pages: 1