Maximus creates way too many processes

Bug #401916 reported by Chuck Money
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Maximus
Fix Released
High
Jason Smith
maximus (Ubuntu)
Fix Released
Medium
Unassigned
Karmic
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: maximus

On both Ubuntu 9.04 and Ubuntu-netbook-remix 9.04 I am using Maximus and I love it, however both share a common problem. I'm running netbook-remix on an ASUS EEE 901, and standard Ubuntu (amd64, installed from alt cd just for expediency) on an ASUS N80vn-A1. In both cases, whenever I launch any application, maximus starts a new thread along with it. However, when the application closes, the maximus threat takes a very long time to close. When I reboot, my session saves running apps, and this usually includes 10 to 15 running Maximus processes for applications I closed several minutes prior to reboot. Upon completeing the reboot and login, the previous lingering processes are started again - but never die. On my ASUS N80vn I now have 27 Maximus processes with only Evolution, Firefox, Rhythmbox, and Tilda running. Since Tilda has no taskbar entry and Rhythmbox stays in my tray I don't think they should have running Maximus tasks, but even so, 27 Maximus tasks for 4 running applications is insane.

What I'd like is for Maximus to kill its own sleeping threads immediately, or at worst, in just a few seconds, instead of not dying several minutes later. I understand this may be a small performance hit but having 23 undead background processes is a much harder one!

Related branches

Revision history for this message
R4kk00n (r4kk00n) wrote :

On my Aspire One 531h the performance hit is rather large: with about 15 instances of maximus running (started by session manager and supposedly doing nothing) gnome-system-monitor shows 57-59% CPU utilization (that's an N280).

Revision history for this message
Neil J. Patel (njpatel) wrote :

Wow, this is quite weird. Maximus doesn't create threads to deal with anything (libwnck might, but I dont' think it does), so I'm a bit concerned that you are seeing so many instances.

Can you reproduce this on Karmic UNR?

Changed in maximus:
status: New → Incomplete
Revision history for this message
Jason Smith (jassmith) wrote :

Somehow we must be triggering the session management to launch a new instance. Shouldn't be too difficult to check for a running maximus on the current display and refuse to launch in that case.

Revision history for this message
R4kk00n (r4kk00n) wrote :

Same behavior on Karmic alpha from September 16.

Revision history for this message
Chuck Money (chuckdmoney) wrote :

Just wanted to give a small update on this. I'm not using Ubuntu right now but I will be at the Atlanta LinuxCon tomorrow and I intend to set this up in a VM tonight so if anyone from the Ubuntu/Maximus dev team is going to be there, either email me directly (chuckdmoney at gmail dot com) or reply here and I'm subscribed so it'll email me.

That said, I found a workaround for this, however I still consider it a bug. Basically, I had gone into GNOME session settings and told it to automatically remember running programs on logout. With this enabled, when you relogin, Maximus is relaunched every time for every window you had open on the previous logout - even if that specific window is itself no longer running. Thus, after several logout/login or reboots, you have potentially hundreds of dead Maximus theads with no associated window sitting there eating 0.3% CPU/RAM, and after a while this will completely grind a system to a halt. Hence, the temporary workaround is to uncheck that box and then add everything you want to start each session to the other tab in GNOME Session settings manually.

I believe the more permanent solution might be to either patch Maximus or patch the Gnome Session Settings so that Maximus is excluded from being saved in a session, though I'm sure there's some facility I don't know about to exclude things anyway. I would try to patch this myself but unfortunaely I know very little C, almost no C++, and not a single line of Python, so unless GNOME is coded in PHP and nobody told the developers I won't be much help on that end.

Anyhow, if anyone is at LinuxCon tomorrow in Atlanta, email me and we'll find a way to meet each other and I will be happy to replicate the bug in person. If not, I'll see what I can provide as far as a screenshot or log of the problem early next week.

Revision history for this message
Jason Smith (jassmith) wrote :

Confirming. Brilliant bit of debugging work there Chuck. I will take it from here now that I have a point to tackle it from. I wont be in Atlanta but I hope to have this fixed by the time you get home :)

Changed in maximus:
assignee: nobody → Jason Smith (jassmith)
importance: Undecided → High
milestone: none → ubuntu-9.10-beta-freeze
status: Incomplete → Confirmed
Revision history for this message
Loïc Minier (lool) wrote :

Thanks for the research; Neil, Jason, is this something you can look into?

Changed in maximus (Ubuntu):
importance: Undecided → Medium
milestone: none → ubuntu-9.10
status: New → Triaged
Revision history for this message
Loïc Minier (lool) wrote :

Err /me should actually read Jason's last comment; sorry :-)

Revision history for this message
Jason Smith (jassmith) wrote :

Linked branch resolves this issue. It may still be possible to have a minor buildup of .desktop files, however I have not had time to test for it and it would not be the exponential case as before.

Loic, the ball is in your court again :)

Revision history for this message
Jason Smith (jassmith) wrote :

I would like to also leave a comment that this particular behaviour is not specific to maximus and ultimately represents a design flaw within gnome-session that does not allow an application to specify that it should not be saved with a session. More thought will need to be given into how exactly to rectify this issue.

Revision history for this message
Jason Smith (jassmith) wrote :

Fixed in rev 50

Changed in maximus:
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package maximus - 0.4.12-0ubuntu1

---------------
maximus (0.4.12-0ubuntu1) karmic; urgency=low

  * New upstream release.
    - Maximus is a singleton now; LP: #401916.

 -- Loic Minier <email address hidden> Mon, 21 Sep 2009 10:43:35 +0200

Changed in maximus (Ubuntu Karmic):
status: Triaged → Fix Released
Revision history for this message
Paul Larson (pwlars) wrote :

Jason, is there a bug opened against gnome-session for this already?

Jason Smith (jassmith)
Changed in maximus:
status: Fix Committed → Fix Released
Revision history for this message
Chuck Money (chuckdmoney) wrote :

Well...back on Linux now (or at least dual booting, running Mint 7, so basically Ubuntu 9.04) and I'd just like to say that maybe the best fix for this is simply to have gnome-session-manager check it's list of manually specified startup applications, and not run any application from the previous (or saved) session IF a match is found in the static list, since obviously this would always lead to running the same application twice. This would also fix this bug, as Maximus is added as a static entry in gnome-session-manager by default. In the mean time, I'm relaunching Firefox, Thunderbird, Pidgin, Rhythmbox, and about 7 other applications manually as needed every boot because I can't save my session.

Just a thought. Seems like it's literally a single if statement of code, but again I just write PHP so maybe it's harder than it appears.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.