0 Replies Latest reply on Nov 13, 2016 9:44 AM by courtarro

    Memory leak in Lightroom CC 2015.7 related to video cache XML files?

    courtarro

      Problem

      If left alone, my instance of LR will leak memory until the system becomes unusable. The memory usage starts around 1GB and steadily increases by about 1GB per 30-40 minutes. I have disabled all plugins.

       

      Theory

      A background process that involves the video cache is leaking memory when reading the XML files named *.mcdb in the "Adobe\Lightroom\Caches\Video\Media Cache" directory.

       

      Data Point number 1

      I'm using UMDH.exe, the user-mode dump heap tool included in the MS Debugging Tools. I have run the tool on lightroom.exe, then again after I see the memory jump in Task Manager. There are a lot of memory allocations that look similar to this:

       

      ntdll!RtlpAllocateHeap+1099
      ntdll!RtlAllocateHeap+16C
      msxml3!MpHeapAlloc+1C0
      msxml3!Hashtable::init+CE
      msxml3!NamespaceMgr::reset+DB
      msxml3!Document::init+A1
      msxml3!Document::newDocument+31
      msxml3!_createDOMDocument+2C
      msxml3!CreateDOMDocument10+4F
      msxml3!ClassFactory_CreateInstance+5B
      ole32!ICoCreateInstanceEx+3DB (d:\w7rtm\com\ole32\com\objact\objact.cxx, 1196)
      ole32!CoCreateInstance+17B (d:\w7rtm\com\ole32\com\objact\actapi.cxx, 108)
      xml_toolkit!StTempLuaState::`default constructor closure'+103
      xml_toolkit!private_load_AgXML+122
      AgKernel!lua_getinfo+926
      AgKernel!luaopen_table+3628
      AgKernel!lua_yield+201
      AgKernel!AgThrowProgramError+42
      AgKernel!lua_yield+BE
      AgKernel!luaopen_base+1343
      AgKernel!lua_getinfo+926
      AgKernel!luaopen_table+3628
      AgKernel!lua_yield+201
      AgKernel!AgThrowProgramError+42
      AgKernel!lua_yield+BE
      AgKernel!luaopen_base+1343
      AgKernel!lua_getinfo+926
      AgKernel!luaopen_table+3628
      AgKernel!lua_yield+201
      AgKernel!AgThrowProgramError+42
      AgKernel!lua_yield+BE
      AgKernel!luaopen_base+1343

       

      + 4945552 ( 4945552 -      0)   2047 allocsBackTrace9294
      +    2047 (   2047 -      0)BackTrace9294allocations

       

      Data Point number 2

      When I run Process Monitor (a Sysinternals tool), the memory usage increases coincide with a ton of file reads within the Media Cache directory.

       

      Reasoning

      Note the mentions of Lua and CreateDOMDocument in dataset 1. My current theory is that Lightroom has some Lua-based internal processing related to XML that is leaking memory in some or all cases. This XML processing is likely performed on the *.mcdb files that live in "Adobe\Lightroom\Caches\Video\Media Cache". On my machine, I have 2880 such files, probably because I shoot video pretty often and have never intentionally tried to clean this cache. Some of these files may be on disconnected devices, or have moved. Is it possible that there is an error condition on certain files that causes memory cleanup to be skipped? Is it possible that there's a Lua processing bug related to the garbage collection of non-Lua XML functions being called by Lua?

       

      Conclusion

      I've seen people post workarounds to the supposed memory leak bug by deleting the Video directory within Caches, which is likely a bandaid that seems to work because there are, then, fewer *.mcdb files to read and leak. But as the user continues to work with video files, the leak will continue to worsen again. I would like to suggest that Adobe's software folks take a look at this and let me know if there's anything I can do to help. Thanks!