Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-334

Drive: memory leak when running nosetests under Windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.3.1216
    • Component/s: Tests
    • Backlog priority:
      800

      Description

      Running ndrive test under Windows (which launches nosetests) causes the ndrive.exe process to continuously increase the system memory usage, which sometimes leads to a MemoryError, see NXP-13228.

      In fact it looks like a memory leak in the logcapture plugin for nose, as we can see in the logs of NXP-13228:

      22:39:48   File "D:\cygwin\home\Nuxeo\Python\Python27\site-packages\nose\plugins\logcapture.py", line 82, in emit
      22:39:48     self.buffer.append(self.format(record))
      22:39:48 MemoryError
      

      This is strange because looking at logcapture.py, the log buffer should be truncated after each test.

          def afterTest(self, test):
              """Clear buffers after test.
              """
              self.handler.truncate()
      

      Temporarily we can run the tests with the --nologcapture option under Windows, but we need to understand why the buffer is not flushed and how we can solve the issue, maybe by implementing a FileHandler to be used instead of the default MemoryHandler with the nosetests runner, which would also allow us to keep the logs after test execution.

      We might need to be able to debug the running python program to inspect the memory, here's an example:
      http://blog.devork.be/2009/07/how-to-bring-running-python-program.html

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ataillefer Antoine Taillefer
                Reporter:
                ataillefer Antoine Taillefer
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 days
                  2d
                  Remaining:
                  Remaining Estimate - 2 days
                  2d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified