Safari extension consumes memory on idle

Daryn
Daryn
Community Member
edited May 2013 in 1Password 3 – 7 for Mac

I've been suffering terrible memory leaks in Safari Web Content for quite some time now. I have to restart Safari multiple times/day because it will routinely bloat to 1+GB resident memory. Bad news: it's the 1Password plugin. Good news: it's trivial to reproduce, but first, my vanilla configuration:

OS 10.8.3

1Password 3.8.21

Safari 6.0.4

• Internet Plug-Ins: JavaAppletPlugin, JavaPlugin2_Webkit, Quartz Composer, QuickTime

• Extensions: 1Password 3.9.14

• Java Disabled

Today I stumbled across the SunSpider javascript benchmark (http://www.webkit.org/perf/sunspider/sunspider.html). Every time I ran it, Safari massively bloated! I was going to file a radar bug on Safari but instead I decided to poke around. I got rid of the flash, silverlight, and hulu desktop plugins. No change. I disabled 1Password. Memory leak is gone.

With 1Password disabled, I ran the benchmark 6 times and resident memory leveled out at ~230MB and wouldn't go higher. Enabled 1Password, and ran the benchmark: 600MB, 882MB, 1004MB - just keeps climbing. Disable 1Password extension, run benchmark repeatedly: resident increases 10-20MB, but drops back down when benchmark completes.

So javascript + 1Password = leak leak leak. I'm now suffering with enabling 1Password only when I need to use it.

Comments

  • khad
    khad
    1Password Alumni
    edited May 2013

    Thanks for taking the time to contact us. This is a known issue (RM4308), but the exact cause has not yet been determined. SunSpider is a really dramatic example, but the issue does occur very slowly over time in normal usage. One thing that should serve as a workaround for now is to disable autosave (Settings > Logins).

    As we continue to investigate this issue, please let me know if disabling autosave helps in your case as it has in others.

  • Daryn
    Daryn
    Community Member

    Thanks for the reply! Unfortunately disabling that option didn't make any difference. I even unchecked all 3 options and it didn't help.

  • Hi Daryn,

    There isn't a solution for this yet. What is happening in Sunspider is that for each test frame it runs, a copy of the 1Password extension scripts is injected into the test frame. The leak comes from the fact that Safari doesn't aggressively clear out the copy from the previous frames. So you have hundreds of the tiny scripts left in memory for the auto-fill and auto-save to work properly for all sites and it never went away.

    We're always looking into a better solution for this, we made some progress a while ago to optimize the scripts but we still have more to go.

    Hopefully, Apple will also optimize Safari further in future versions to help 1Password by being a bit more aggressive with the cleaning up parts.

  • jguilfoy
    jguilfoy
    Community Member

    Any updates on this? I have had to disable your plugin with Safari consuming >6GB of RAM after 24 hours...

  • khad
    khad
    1Password Alumni

    This is resolved for the future, but I don't have a time frame for when it will be released.

This discussion has been closed.