summaryrefslogtreecommitdiffstats
path: root/base/memory/discardable_memory_linux.cc
Commit message (Collapse)AuthorAgeFilesLines
* Reland r267170 "Use DiscardableMemoryManager on Android."pliard@chromium.org2014-04-301-6/+1
| | | | | | | | | | | | | | | | This allows userspace (DiscardableMemoryManager) to control eviction of unlocked DiscardableMemory instances to prevent the process from running out of address space in cases of heavy use of unlocked DiscardableMemory. This also removes all the occurences of 'Android' from the ashmem allocator to allow it to be later used on ChromeOS. BUG=327516, 334996 TBR=willchan@chromium.org Review URL: https://codereview.chromium.org/253323002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267211 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 267170 "Use DiscardableMemoryManager on Android."pliard@chromium.org2014-04-301-1/+6
| | | | | | | | | | | | | | | | | | | | | | > Use DiscardableMemoryManager on Android. > > This allows userspace (DiscardableMemoryManager) to control eviction of > unlocked DiscardableMemory instances to prevent the process from running out of > address space in cases of heavy use of unlocked DiscardableMemory. > > This also removes all the occurences of 'Android' from the ashmem allocator to > allow it to be later used on ChromeOS. > > BUG=327516, 334996 > R=reveman@chromium.org, willchan@chromium.org > > Review URL: https://codereview.chromium.org/195863005 TBR=pliard@chromium.org Review URL: https://codereview.chromium.org/257383004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267175 0039d316-1c4b-4281-b951-d872f2087c98
* Use DiscardableMemoryManager on Android.pliard@chromium.org2014-04-301-6/+1
| | | | | | | | | | | | | | | | This allows userspace (DiscardableMemoryManager) to control eviction of unlocked DiscardableMemory instances to prevent the process from running out of address space in cases of heavy use of unlocked DiscardableMemory. This also removes all the occurences of 'Android' from the ashmem allocator to allow it to be later used on ChromeOS. BUG=327516, 334996 R=reveman@chromium.org, willchan@chromium.org Review URL: https://codereview.chromium.org/195863005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267170 0039d316-1c4b-4281-b951-d872f2087c98
* base: Add uncached malloc based discardable memory type.reveman@chromium.org2014-02-101-1/+11
| | | | | | | | | | | | | | | | | Each DiscardableMemoryMalloc instance uses a separate malloc() allocated block of memory. It's allocated on Lock() and freed on Unlock(). This is useful to test how discardable memory clients perform in situations when the memory pressure is high. The base class will also be used by other discardable memory implementations as a fall-back when failing to allocate/lock native discardable memory. BUG=334996 TEST=base_unittests --gtest_filter=DiscardableMemoryTests* Review URL: https://codereview.chromium.org/145643008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250167 0039d316-1c4b-4281-b951-d872f2087c98
* Re-land: base: Fix registering of memory pressure listeners used when ↵reveman@chromium.org2014-01-141-0/+10
| | | | | | | | | | | | | | | | | | | | | emulating discardable memory. Memory pressure listeners need to be created on a thread with a message loop current. Discardable memory is often used on worker threads that don't have a message loop and with the current system where listeners are registered on first use, the result is that we're most likely never notified of memory pressure. This adds a function to the discardable memory interface that allows us to register memory pressure listeners on a thread, and at a time, when we know a message loop is current. BUG=332570 TBR=jamesr@chromium.org Review URL: https://codereview.chromium.org/129963002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244641 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 244229 "base: Fix registering of memory pressure listener..."reveman@chromium.org2014-01-111-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Causing webkit_unit_tests to fail. > base: Fix registering of memory pressure listeners used when emulating discardable memory. > > Memory pressure listeners need to be created on a thread with a message > loop current. Discardable memory is often used on worker threads that > don't have a message loop and with the current system where listeners > are registered on first use, the result is that we're most likely never > notified of memory pressure. > > This adds a function to the discardable memory interface that allows us > to register memory pressure listeners on a thread, and at a time, when > we know a message loop is current. > > BUG=332570 > TBR=jamesr@chromium.org > > Review URL: https://codereview.chromium.org/129963002 TBR=reveman@chromium.org Review URL: https://codereview.chromium.org/135113003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244278 0039d316-1c4b-4281-b951-d872f2087c98
* base: Fix registering of memory pressure listeners used when emulating ↵reveman@chromium.org2014-01-101-0/+10
| | | | | | | | | | | | | | | | | | | | | discardable memory. Memory pressure listeners need to be created on a thread with a message loop current. Discardable memory is often used on worker threads that don't have a message loop and with the current system where listeners are registered on first use, the result is that we're most likely never notified of memory pressure. This adds a function to the discardable memory interface that allows us to register memory pressure listeners on a thread, and at a time, when we know a message loop is current. BUG=332570 TBR=jamesr@chromium.org Review URL: https://codereview.chromium.org/129963002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244229 0039d316-1c4b-4281-b951-d872f2087c98
* base: Discardable memory types.reveman@chromium.org2014-01-081-10/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a DiscardableMemoryType enum and a function that can be used to select what type of discardable memory to use. This is generally useful for debugging purposes and when evaluating the performance of one implementation vs another. The unit test framework for discardable memory is improved slightly by testing every supported type on each platform rather then just the one specific type. Furthermore, it allows us to expose ashmem based discardable memory on ChromeOS in about:flags before we make it default. No change in behavior unless the new --use-discardable-memory=type switch is used. BUG=327516 TEST=base_unitttest --gtest_filter=DiscardableMemory* TBR=tomhudson@google.com Review URL: https://codereview.chromium.org/114923005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243532 0039d316-1c4b-4281-b951-d872f2087c98
* base: Refactor DiscardableMemoryProvider to build and be tested on all ↵reveman@chromium.org2013-12-161-0/+35
platforms. This also moves DiscardableMemory::CreateLockedMemory implementations to platform specific files and allows us to choose what implementation to use at runtime. No change in behavior, refactor only. BUG=327516 TEST=base_unitttest --gtest_filter=DiscardableMemory* Review URL: https://codereview.chromium.org/111713008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240924 0039d316-1c4b-4281-b951-d872f2087c98