<?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>164862</bug_id>
          
          <creation_ts>2016-11-17 02:32:48 -0800</creation_ts>
          <short_desc>[Win32] Start releasing memory earlier when memory is running low.</short_desc>
          <delta_ts>2016-11-18 02:03:28 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Per Arne Vollan">pvollan</reporter>
          <assigned_to name="Per Arne Vollan">pvollan</assigned_to>
          <cc>achristensen</cc>
    
    <cc>bfulgham</cc>
    
    <cc>commit-queue</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1252261</commentid>
    <comment_count>0</comment_count>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2016-11-17 02:32:48 -0800</bug_when>
    <thetext>On Windows, 32-bit processes have 2GB of memory available, where some is used by the system. Debugging has shown that allocations might fail and cause crashes when memory usage is &gt; ~1GB. We should start releasing memory before we reach 1GB.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252262</commentid>
    <comment_count>1</comment_count>
      <attachid>295043</attachid>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2016-11-17 02:36:29 -0800</bug_when>
    <thetext>Created attachment 295043
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252274</commentid>
    <comment_count>2</comment_count>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2016-11-17 04:24:27 -0800</bug_when>
    <thetext>&lt;rdar://problem/27988989&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252317</commentid>
    <comment_count>3</comment_count>
      <attachid>295043</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2016-11-17 09:59:09 -0800</bug_when>
    <thetext>Comment on attachment 295043
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=295043&amp;action=review

r=me

&gt; Source/WebCore/platform/win/MemoryPressureHandlerWin.cpp:77
&gt; +    const int maxMemoryUsageBytes = 0.9 * 1024 * 1024 * 1024;

So we trigger clean-up about 10% earlier than before? Seems reasonable.

Would it make sense to convert this from a floating point calculation to just hard-coding the actual integer value that results from this math?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252632</commentid>
    <comment_count>4</comment_count>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2016-11-18 01:43:52 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; Comment on attachment 295043 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=295043&amp;action=review
&gt; 
&gt; r=me
&gt; 
&gt; &gt; Source/WebCore/platform/win/MemoryPressureHandlerWin.cpp:77
&gt; &gt; +    const int maxMemoryUsageBytes = 0.9 * 1024 * 1024 * 1024;
&gt; 
&gt; So we trigger clean-up about 10% earlier than before? Seems reasonable.
&gt; 
&gt; Would it make sense to convert this from a floating point calculation to
&gt; just hard-coding the actual integer value that results from this math?

I checked the generated code, and the compiler will optimize this. Just let me know if you still want me to change it :)

Thanks for reviewing!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252633</commentid>
    <comment_count>5</comment_count>
      <attachid>295043</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-11-18 02:03:24 -0800</bug_when>
    <thetext>Comment on attachment 295043
Patch

Clearing flags on attachment: 295043

Committed r208883: &lt;http://trac.webkit.org/changeset/208883&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252634</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-11-18 02:03:28 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>295043</attachid>
            <date>2016-11-17 02:36:29 -0800</date>
            <delta_ts>2016-11-18 02:03:24 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-164862-20161117023623.patch</filename>
            <type>text/plain</type>
            <size>1724</size>
            <attacher name="Per Arne Vollan">pvollan</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDIwODg0MykKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE3IEBACisyMDE2LTExLTE3ICBQZXIgQXJu
ZSBWb2xsYW4gIDxwdm9sbGFuQGFwcGxlLmNvbT4KKworICAgICAgICBbV2luMzJdIFN0YXJ0IHJl
bGVhc2luZyBtZW1vcnkgZWFybGllciB3aGVuIG1lbW9yeSBpcyBydW5uaW5nIGxvdy4KKyAgICAg
ICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTE2NDg2MgorCisgICAg
ICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgor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