<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>65585</bug_id>
          
          <creation_ts>2011-08-02 17:29:18 -0700</creation_ts>
          <short_desc>JSC GC may not be able to reuse partially-free blocks after a full collection</short_desc>
          <delta_ts>2011-08-02 18:48:31 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Filip Pizlo">fpizlo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>barraclough</cc>
    
    <cc>fpizlo</cc>
    
    <cc>oliver</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>445633</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2011-08-02 17:29:18 -0700</bug_when>
    <thetext>The JSC GC has a quirk in the management of free blocks, where when a free block is removed from a size class, all blocks prior to that one may also be removed from the size class&apos;s list of to-sweep blocks.  The lazy sweep will then overlook these blocks and allocate fresh blocks instead of reusing free space in partially-free blocks.  This pathology will persist only until the next non-full collection, so it only has two effects:

1) The next collection may come sooner than otherwise, if there is a lot of free space in partially-free blocks.

2) The allocator has fewer opportunities to &quot;fill in&quot; fragmentation.  Oddly, this might be good for performance.  But on the downside, it may lead to more fragmentation in the long run.

Notably, other than the risk of fragmentation, this bug does not degrade memory usage - it only has the potential pathology of decreasing the time-to-next-collection after a full collection.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>445635</commentid>
    <comment_count>1</comment_count>
      <attachid>102719</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2011-08-02 17:32:03 -0700</bug_when>
    <thetext>Created attachment 102719
the patch

Tests still running, will set flags to ? when they&apos;re done.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>445642</commentid>
    <comment_count>2</comment_count>
      <attachid>102719</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2011-08-02 17:45:15 -0700</bug_when>
    <thetext>Comment on attachment 102719
the patch

All tests pass.  No performance regression on either my Mac Pro or my iMac.  It&apos;s ready for review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>445664</commentid>
    <comment_count>3</comment_count>
      <attachid>102719</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-08-02 18:48:27 -0700</bug_when>
    <thetext>Comment on attachment 102719
the patch

Clearing flags on attachment: 102719

Committed r92251: &lt;http://trac.webkit.org/changeset/92251&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>445665</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-08-02 18:48:31 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>102719</attachid>
            <date>2011-08-02 17:32:03 -0700</date>
            <delta_ts>2011-08-02 18:48:27 -0700</delta_ts>
            <desc>the patch</desc>
            <filename>freelistbug_patch_1.diff</filename>
            <type>text/plain</type>
            <size>1340</size>
            <attacher name="Filip Pizlo">fpizlo</attacher>
            
              <data encoding="base64">SW5kZXg6IF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09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9KYXZhU2NyaXB0
Q29yZS9oZWFwL05ld1NwYWNlLmNwcAkocmV2aXNpb24gOTIyNDcpCisrKyBTb3VyY2UvSmF2YVNj
cmlwdENvcmUvaGVhcC9OZXdTcGFjZS5jcHAJKHdvcmtpbmcgY29weSkKQEAgLTU4LDcgKzU4LDgg
QEAgdm9pZCBOZXdTcGFjZTo6cmVtb3ZlQmxvY2soTWFya2VkQmxvY2sqIAogewogICAgIGJsb2Nr
LT5zZXRJbk5ld1NwYWNlKGZhbHNlKTsKICAgICBTaXplQ2xhc3MmIHNpemVDbGFzcyA9IHNpemVD
bGFzc0ZvcihibG9jay0+Y2VsbFNpemUoKSk7Ci0gICAgc2l6ZUNsYXNzLm5leHRCbG9jayA9IGJs
b2NrLT5uZXh0KCk7CisgICAgaWYgKHNpemVDbGFzcy5uZXh0QmxvY2sgPT0gYmxvY2spCisgICAg
ICAgIHNpemVDbGFzcy5uZXh0QmxvY2sgPSBibG9jay0+bmV4dCgpOwogICAgIHNpemVDbGFzcy5i
bG9ja0xpc3QucmVtb3ZlKGJsb2NrKTsKIH0KIAo=
</data>

          </attachment>
      

    </bug>

</bugzilla>