[gdm-list] Reason for not reaping X11 login screen



Hello,

I noticed that gdm does not reap the login screen once a session is
started, consuming quite a lot of memory. When digging through the code
I found the following explicit exception when the login screen is
running on X11:

        /* we can only stop greeter for wayland sessions, since
         * X server would jump back on exit */
        if (g_strcmp0 (display_session_type, "wayland") != 0) {
                g_debug ("GdmLocalDisplayFactory: login window is running on Xorg, so ignoring");
                return;
        }

Removing that exception and adding -novtswitch to the X11 server options seems
to work perfectly though (at least with gdm-3.32.0 I tested this with).

Is there any particular reason, not to use that option and allow reaping
of the greeter under X11?

diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index da1093bb..ebe452b0 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -684,13 +684,6 @@ maybe_stop_greeter_in_background (GdmLocalDisplayFactory *factory,
                 return;
         }
 
-        /* we can only stop greeter for wayland sessions, since
-         * X server would jump back on exit */
-        if (g_strcmp0 (display_session_type, "wayland") != 0) {
-                g_debug ("GdmLocalDisplayFactory: login window is running on Xorg, so ignoring");
-                return;
-        }
-
         g_debug ("GdmLocalDisplayFactory: killing login window once its unused");
 
         g_object_set (G_OBJECT (display), "status", GDM_DISPLAY_WAITING_TO_FINISH, NULL);
diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c
index 58865a6c..f0082fdc 100644
--- a/daemon/gdm-x-session.c
+++ b/daemon/gdm-x-session.c
@@ -277,6 +277,7 @@ spawn_x_server (State        *state,
 
         g_ptr_array_add (arguments, "-noreset");
         g_ptr_array_add (arguments, "-keeptty");
+        g_ptr_array_add (arguments, "-novtswitch");
 
         g_ptr_array_add (arguments, "-verbose");
         if (state->debug_enabled) {
-- 
Thanks,
Michael


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]