How can I tell if a memory leak is in user space or kernel space?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have a large multi-threaded open source application which uses proprietary OpenGL libraries, Wayland Weston, and a proprietary graphics driver in the Linux kernel. The drivers are currently under development, so there is a strong possibility that they have errors.



I have observed the following symptoms:



(1) Free memory ($ free -m) is continuously consumed while running my application. At a steady state, it consumes about 5MB/minute.



(2) If I stop and start my application continuously, I am able to accelerate the rate of memory loss. It looks like I lose about 0.5MB every time I restart the application.



(3) When I stop my application, the memory is not returned to the system. The memory is returned only after a power cycle.



(4) I have started to log memory usage, as well as taking snapshots of /proc/<pid>/smaps. I can see which thread consumes the memory, and I will investigate further.



(5) inspection of the smaps file shows that, over time, the older snapshot has consumed more memory. There are also more "anon_inode:dmabuf" entries in the older snapshot, and this looks similar to these issues:



https://stackoverflow.com/questions/28097766/where-does-the-dev-zero-deleted-anon-inodedmabuf-comes-from-in-proc-p



https://bugs.freedesktop.org/show_bug.cgi?id=100298



Is this memory leak more likely to be a user space memory leak or a kernel memory leak?



What other diagnostics can I perform to narrow down the likely source of leaks?









share

























    up vote
    0
    down vote

    favorite












    I have a large multi-threaded open source application which uses proprietary OpenGL libraries, Wayland Weston, and a proprietary graphics driver in the Linux kernel. The drivers are currently under development, so there is a strong possibility that they have errors.



    I have observed the following symptoms:



    (1) Free memory ($ free -m) is continuously consumed while running my application. At a steady state, it consumes about 5MB/minute.



    (2) If I stop and start my application continuously, I am able to accelerate the rate of memory loss. It looks like I lose about 0.5MB every time I restart the application.



    (3) When I stop my application, the memory is not returned to the system. The memory is returned only after a power cycle.



    (4) I have started to log memory usage, as well as taking snapshots of /proc/<pid>/smaps. I can see which thread consumes the memory, and I will investigate further.



    (5) inspection of the smaps file shows that, over time, the older snapshot has consumed more memory. There are also more "anon_inode:dmabuf" entries in the older snapshot, and this looks similar to these issues:



    https://stackoverflow.com/questions/28097766/where-does-the-dev-zero-deleted-anon-inodedmabuf-comes-from-in-proc-p



    https://bugs.freedesktop.org/show_bug.cgi?id=100298



    Is this memory leak more likely to be a user space memory leak or a kernel memory leak?



    What other diagnostics can I perform to narrow down the likely source of leaks?









    share























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a large multi-threaded open source application which uses proprietary OpenGL libraries, Wayland Weston, and a proprietary graphics driver in the Linux kernel. The drivers are currently under development, so there is a strong possibility that they have errors.



      I have observed the following symptoms:



      (1) Free memory ($ free -m) is continuously consumed while running my application. At a steady state, it consumes about 5MB/minute.



      (2) If I stop and start my application continuously, I am able to accelerate the rate of memory loss. It looks like I lose about 0.5MB every time I restart the application.



      (3) When I stop my application, the memory is not returned to the system. The memory is returned only after a power cycle.



      (4) I have started to log memory usage, as well as taking snapshots of /proc/<pid>/smaps. I can see which thread consumes the memory, and I will investigate further.



      (5) inspection of the smaps file shows that, over time, the older snapshot has consumed more memory. There are also more "anon_inode:dmabuf" entries in the older snapshot, and this looks similar to these issues:



      https://stackoverflow.com/questions/28097766/where-does-the-dev-zero-deleted-anon-inodedmabuf-comes-from-in-proc-p



      https://bugs.freedesktop.org/show_bug.cgi?id=100298



      Is this memory leak more likely to be a user space memory leak or a kernel memory leak?



      What other diagnostics can I perform to narrow down the likely source of leaks?









      share













      I have a large multi-threaded open source application which uses proprietary OpenGL libraries, Wayland Weston, and a proprietary graphics driver in the Linux kernel. The drivers are currently under development, so there is a strong possibility that they have errors.



      I have observed the following symptoms:



      (1) Free memory ($ free -m) is continuously consumed while running my application. At a steady state, it consumes about 5MB/minute.



      (2) If I stop and start my application continuously, I am able to accelerate the rate of memory loss. It looks like I lose about 0.5MB every time I restart the application.



      (3) When I stop my application, the memory is not returned to the system. The memory is returned only after a power cycle.



      (4) I have started to log memory usage, as well as taking snapshots of /proc/<pid>/smaps. I can see which thread consumes the memory, and I will investigate further.



      (5) inspection of the smaps file shows that, over time, the older snapshot has consumed more memory. There are also more "anon_inode:dmabuf" entries in the older snapshot, and this looks similar to these issues:



      https://stackoverflow.com/questions/28097766/where-does-the-dev-zero-deleted-anon-inodedmabuf-comes-from-in-proc-p



      https://bugs.freedesktop.org/show_bug.cgi?id=100298



      Is this memory leak more likely to be a user space memory leak or a kernel memory leak?



      What other diagnostics can I perform to narrow down the likely source of leaks?







      memory wayland opengl





      share












      share










      share



      share










      asked 6 mins ago









      Mr Stinky

      1747




      1747

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475298%2fhow-can-i-tell-if-a-memory-leak-is-in-user-space-or-kernel-space%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475298%2fhow-can-i-tell-if-a-memory-leak-is-in-user-space-or-kernel-space%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?