Closed
Bug 592308
Opened 15 years ago
Closed 15 years ago
IsLowMemory() is terribly slow and there is nothing to do about it.
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla2.0b7
Tracking | Status | |
---|---|---|
fennec | 2.0+ | --- |
People
(Reporter: dougt, Assigned: dougt)
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
12.83 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
The IsLowMemory predicate allows a piece of code test to see if we are in a low memory situation. We only do this sort of test in two major places:
1) allocation of image data
2) during js callbacks
Testing for low memory requires us to read proc files, or acquire a kernal lock (like when we have to call into GlobalMemoryStatus on windows). On Windows CE we disabled this check all together because of the cost.
(1) doesn't really matter that much in terms of perf, but (2) really does.
In addition, some memory allocators do reservations and commit on write. In this case, the test would not actually do what you wanted.
So, I think we should move away from using IsLowMemory. Instead, we should continue broadcasting memory-pressure notifications when we can and if the OS has such a feature. For example, on osso, we get a notification that our process is running low on memory. We can also detect this on Android.
If this is agreeable, we can remove the IsLowMemory() callers, make the call return false, and add documentation about deprecating this method.
Assignee | ||
Updated•15 years ago
|
tracking-fennec: --- → ?
OS: Linux → All
Hardware: x86_64 → All
Assignee | ||
Comment 1•15 years ago
|
||
Assignee: nobody → doug.turner
Assignee | ||
Updated•15 years ago
|
Attachment #470824 -
Flags: review?(benjamin)
Updated•15 years ago
|
Attachment #470824 -
Flags: review?(benjamin) → review+
Updated•15 years ago
|
tracking-fennec: ? → 2.0+
Assignee | ||
Updated•15 years ago
|
Keywords: dev-doc-needed
Comment 2•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b6
Comment 3•15 years ago
|
||
Documented this change:
https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIMemory/isLowMemory
And mentioned it here as well:
https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIMemory
and of course on Fx4 for developers.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•