Lightroom 5: Lr using too much memory during startup

  • 1
  • Problem
  • Updated 4 years ago
Here is memory consumption when starting Lr in library module with no photo selected and many plugins disabled:



With more of my plugins enabled, or when starting Lr with a photo selected in develop module, the memory consumption exceeds 100% (and so disk gets used for ram..), and my whole computer becomes non-responsive - it takes several minutes before system returns to normal and I can use computer, and Lightroom..

Rob
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 379 Reply Likes

Posted 4 years ago

  • 1
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 379 Reply Likes
Not sure why the saw-tooth sometimes but not others - here's another Lr startup profile:



No differences in Lr config etc. - go figure...
Photo of Jim Wilde

Jim Wilde, Champion

  • 269 Posts
  • 82 Reply Likes
And this is mine:

Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 379 Reply Likes
My Lr is loading & compiling a bunch of plugins during startup, all of which use a beefy framework, which is probably the reason I am having the problem and people like Jim Wilde are not. I could pre-compile my plugins and cut down the burden, but I really don't want to. I could recode them to reduce amount of code being loaded for each plugin, but that would be a lot of work, and I really don't want to do it. So my work-around for now is to disable and/or uninstall all plugins I'm not actively using. A better long term solution would be if Lr loaded & initialized plugins sequentially instead of in parallel - I think that would do it.

But regardless of any of this, it doesn't explain why sometimes there is a saw-tooth pattern and sometimes a hill - in my case a big hill, in Jim's case a small hill. When it's a hill, I don't have the problem, when it's a saw-tooth, whether I have the problem depends on whether it stops shy of 99% or proceeds past 99%.

FWIW - Jim has more ram than me, which makes for flatter looking hills.

My situation is unique because I load several dozen plugins during startup, but other people see the same behavior for other reasons. Begs the question of whether it's prudent to just motor on using virtual memory when real memory is exhausted, and begs the question: why is real memory consumption skyrocketing in some cases, even if released a moment later.

Rob
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 379 Reply Likes
Could have been worse:

over 99% for only a short while so system not completely unresponsive and back to normal within a few minutes, instead of several/many minutes..

R
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 379 Reply Likes
Problem caused be inefficient coding of lua serialization function (derived from Debug.lognpp).

the spikes are a series of string concatenations which really should use a string buffer instead (i.e. array of strings - concatenated for final result).

Function was not only inefficient memory-wise, but also time-wise, since it was creating an entirely new string just to add a few characters, and then again, and again...

Fixed now.

To plugin authors using John Ellis' Debug Toolkit - consider getting a new version from John (I'm assuming he'll fix this function).

To plugin authors using Elare Plugin Framework - consider upgrading the framework to version 0.5 or better.

To users using my SQLiteroom plugin (a primary offender), or any of my other plugins consuming too much memory, especially if tell-tale spike pattern as seen above, look for an upgrade (should be released soon).

Rob