Bug 159688 - [Cocoa] Simulated memory warning doesn't trigger libcache purge.
Summary: [Cocoa] Simulated memory warning doesn't trigger libcache purge.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords: InRadar, Performance
Depends on:
Blocks:
 
Reported: 2016-07-12 14:15 PDT by Andreas Kling
Modified: 2016-07-13 14:41 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.97 KB, patch)
2016-07-12 14:16 PDT, Andreas Kling
cdumez: review+
Details | Formatted Diff | Diff
Patch for landing (2.93 KB, patch)
2016-07-12 20:36 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2016-07-12 14:15:08 PDT
We're not poking libcache to purge caches in response to fake memory pressure.
Comment 1 Andreas Kling 2016-07-12 14:16:47 PDT
Created attachment 283446 [details]
Patch
Comment 2 Alexey Proskuryakov 2016-07-12 16:58:27 PDT
Comment on attachment 283446 [details]
Patch

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

> Source/WebCore/platform/MemoryPressureHandler.h:146
> +    bool m_isFakeMemoryPressure { false };

What is the official name, "fake" or "simulated"?
Comment 3 Chris Dumez 2016-07-12 16:59:05 PDT
Comment on attachment 283446 [details]
Patch

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

>> Source/WebCore/platform/MemoryPressureHandler.h:146
>> +    bool m_isFakeMemoryPressure { false };
> 
> What is the official name, "fake" or "simulated"?

+1 for simulated
Comment 4 Andreas Kling 2016-07-12 17:04:18 PDT
"simulated" sounds nice, let's call it that instead!
Comment 5 Chris Dumez 2016-07-12 18:27:49 PDT
Comment on attachment 283446 [details]
Patch

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

R=me with comments.

>>> Source/WebCore/platform/MemoryPressureHandler.h:146
>>> +    bool m_isFakeMemoryPressure { false };
>> 
>> What is the official name, "fake" or "simulated"?
> 
> +1 for simulated

Let's rename then.

> Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm:142
> +        m_isFakeMemoryPressure = true;

Can we use WTF TemporaryChange?
Comment 6 Andreas Kling 2016-07-12 19:52:18 PDT
(In reply to comment #5)
> Comment on attachment 283446 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=283446&action=review
> 
> R=me with comments.

Thanks!

> > Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm:142
> > +        m_isFakeMemoryPressure = true;
> 
> Can we use WTF TemporaryChange?

Unfortunately not, since the reset to false happens in a block that gets called on next runloop.
Comment 7 Andreas Kling 2016-07-12 20:36:19 PDT
Created attachment 283487 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2016-07-12 21:05:52 PDT
Comment on attachment 283487 [details]
Patch for landing

Clearing flags on attachment: 283487

Committed r203149: <http://trac.webkit.org/changeset/203149>
Comment 9 WebKit Commit Bot 2016-07-12 21:05:56 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Andreas Kling 2016-07-13 14:41:58 PDT
<rdar://problem/25479969>