Using R7.5 with xserver v1.7.1 and vesa driver 2.3.0, it appears a
small leak occurs on each XOpenDisplay/XCloseDisplay call pair.  This
was encountered during some unrelated testing, and eventually
distilled down to those 2 calls.

Previously on 6.9.0 this leak did not occur.  Our application makes
multiple connections over time to the X server, I fear I'm simply
doing something wrong or abusive here, is this a known issue?

With the attached trivial test snippet (just XOpenDisplay followed by
XCloseDisplay), running it continually increases the memory owned by
the X process until it is eventually oom-killed some hours later. I'm
working to remedy the limited debugging utilities available on the
target machine to get more details.

Bug 25029 [1] seemed close, but feels unrelated due to those functions
being called on initialization, not per-connection (unless that's not
the case of course).

[1] https://bugs.freedesktop.org/show_bug.cgi?id=25029
#include <X11/Xlib.h>

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
    unsigned long int cnt = 0l;
    while (1)
    {
        Display* display = XOpenDisplay(NULL);
        assert(display);

        XCloseDisplay(display);

        if (!(++cnt % 1000))
        {
            printf("%8ld iterations complete...\n", cnt);
        }
    }

    return 0;
}

_______________________________________________
[email protected]: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.freedesktop.org/mailman/listinfo/xorg
Your subscription address: [email protected]

Reply via email to