<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:WebKit&#64;JeremyZerfas.com" title="Jeremy Zerfas &lt;WebKit&#64;JeremyZerfas.com&gt;"> <span class="fn">Jeremy Zerfas</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Crash when trying to copy image"
   href="https://bugs.webkit.org/show_bug.cgi?id=125868">bug 125868</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
               &nbsp;
           </td>
           <td>WebKit&#64;JeremyZerfas.com
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Crash when trying to copy image"
   href="https://bugs.webkit.org/show_bug.cgi?id=125868#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Crash when trying to copy image"
   href="https://bugs.webkit.org/show_bug.cgi?id=125868">bug 125868</a>
              from <span class="vcard"><a class="email" href="mailto:WebKit&#64;JeremyZerfas.com" title="Jeremy Zerfas &lt;WebKit&#64;JeremyZerfas.com&gt;"> <span class="fn">Jeremy Zerfas</span></a>
</span></b>
        <pre>I was able to reproduce this bug on a freshly installed Mavericks virtual machine that was set up with 2 GB of memory. It looks like the crashes were happening due to all the memory that is required when processing the animated GIF (800x600 resolution x 439 frames in the animation * 32 bits per pixel = ~804 MiB when uncompressed). Updating to Safari 7.1.8 seems to largely have resolved the issue by getting rid of the crashes. However during and after copying an image into the clipboard Safari still seems to be using up more memory than is necessary.

While looking at this bug I did notice that when copying an image to the clipboard, WebKit allocates an NSImage that isn't needed. The patch I'm adding causes it to to not allocate the NSImage. With the animation from this bug, the patch considerably reduces the amount of memory and CPU time used when copying an image to the clipboard. Originally when copying the animation on my Mac, the resident memory size would increase to ~2,750 MiB. With the patch applied the resident memory size only increases up to ~1,150 MiB and the process also finishes about 1.75 seconds faster.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>