This disclosure relates generally to memory management in data processing systems such as computers, smart phones, etc.
Memory management in a data processing system is often performed by software that can be considered part of an operating system software that manages software processes and device hardware and provides common services for application programs. These common services can include virtual memory management, scheduling of processes or threads, resource allocation among application programs, input/output control, etc. Memory management has become important in part because many modern devices (e.g., iPhone or iPad from Apple, Inc. of Cupertino, Calif.) often concurrently run many processes or applications in the background while one application program (e.g., a web browser) is the foreground application. For example, while the web browser executes as the foreground application (receiving and responding to user inputs), a set of applications, such as a media player application for playing music, an email application, a text messaging application, etc. and a set of daemons can also be executing or at least consuming memory resources even when they are not executing (such as idle or suspended applications). Moreover, many mobile devices, such as smartphones, often have much less DRAM memory (used to store software code and data for executing or idle, suspended applications) than desktop or laptop computers and no hard drive as a backing store (for a swap space), and thus such mobile devices, after being used for an extended period of many days, can have very link free (unused) DRAM available for allocation to a newly launched application or process, and this can force the memory management system to reclaim memory before the newly launched application can be provided DRAM memory. As a result, the launching by a user of the newly launched application can appear to be sluggish to the user.
Methods and systems described herein can be implemented by data processing systems, such as smart phones, tablet computers, desktop computers, laptop computers, smart watches, wearable accessories, and other data processing systems and other consumer electronic devices. The methods and systems described herein can also be implemented by one or more data processing systems which execute executable computer program instructions, stored in one or more non-transitory machine readable media that cause the one or more data processing systems to perform the one or more methods described herein when the program instructions are executed. Thus, the embodiments described herein can include methods, data processing systems, and non-transitory machine readable media.
The embodiments described herein provide a memory management system that manages a memory space (e.g., a virtual memory space) that includes volatile memory (e.g. DRAM) and non-volatile memory (e.g., flash memory) and creates a reserved portion of memory in the volatile memory for at least one predetermined user application, and in one embodiment, that reserved portion can also store content (e.g. software libraries) that is restricted to read only permission within the non-volatile memory.
A method in one embodiment can include the following operations performed by a memory management system: reserving a portion of volatile memory for use by at least one predetermined application, wherein the predetermined application is one of a plurality of applications on a data processing system that includes the memory management system and the reserving creates a reserved portion; storing in the reserved portion content that is restricted as read only (no writing permitted) in non-volatile memory, wherein the content is read from the non-volatile memory and written into the reserved portion; and storing, in response to the predetermined application being launched, one or more of software code or data of the predetermined application in the reserved portion. In one embodiment, when the predetermined application is launched, at least a portion of the software code or data of the predetermined application is stored in a free portion of the volatile memory if available, as indicated by a free page queue, before storing other portions of the software code of data of the predetermined application in the reserved portion. In one embodiment if, when the predetermined application is launched, no free portions of the volatile memory are available, as indicated by a free page queue, and insufficient free portions of the reserved portion are available, as indicated by a reserved page queue, then the memory management system reclaims memory pages within the reserved portion instead of waiting for the system to reclaim memory pages within other portions of the volatile memory. In one embodiment, the reclaiming of memory pages within the reserved portion is performed without performing a page out from the memory pages within the reserved portion to the non-volatile memory. In one embodiment, the reserving of the reserved portion is performed initially at boot time of the data processing system, and the content that is restricted as read only includes read only software libraries (which can be code signed) or other read only files, hi one embodiment the predetermined application is predetermined either: (a) at compile time of an operating system (OS) that includes the memory management system or (b) dynamically at run time based on either a user input/selection or an OS selection, and wherein the predetermined application is a user application that runs in user memory space. In one embodiment, the predetermined application is a camera application that operates with an imaging system to capture still images and/or video.
A method according to an embodiment described herein can include the following operations performed by a memory management system: determining from a free page queue, in response to a request for one or more free pages of memory in volatile memory, whether a memory page is available for use by an application; providing to the application a free page if the free page queue is not empty; determining, in response to determining the free page queue is empty or has insufficient pages for the request, if the application is classified as a predetermined application; providing to the predetermined application a free page from a reserved page queue for a reserved portion of volatile memory. In one embodiment of this method, content that is restricted as read only in non-volatile memory is also stored in the reserved portion and this content can include software libraries that are stored in the non-volatile memory and are code signed (for security) and contain one or more code signatures that can be validated before executing the software. In one embodiment of this method, if insufficient free portions are available from both the reserved portion and the rest of the volatile memory then when the predetermined application is launched (or becomes the foreground app) the memory management system reclaims memory pages within the reserved portion instead of waiting for the system to reclaim memory pages from other portions of the volatile memory.
The methods and systems described herein can be implemented by data processing systems, such as smartphones, tablet computers, desktop computers, laptop computers, smart watches, audio accessories, and other data processing systems and other consumer electronic devices. The methods and systems described herein can also be implemented by one or more data processing systems which execute executable computer program instructions, stored in one or more non-transitory machine readable media that cause the one or more data processing systems to perform the one or more methods described herein when the program instructions are executed. Thus, the embodiments described herein can include methods, data processing systems, and non-transitory machine readable media.
The above summary does not include an exhaustive list of all embodiments in this disclosure, AD systems and methods can be practiced from all suitable combinations of the various aspects and embodiments summarized above, and also those disclosed in the Detailed Description below.
The present invention is illustrated by way of example and not limitation in the figures of the accompanying drawings in which like references indicate similar elements.
Various embodiments and aspects will be described with reference to details discussed below, and the accompanying drawings will illustrate the various embodiments. The following description and drawings are illustrative and are not to be construed as limiting. Numerous specific details are described to provide a thorough understanding of various embodiments. However, in certain instances, well-known or conventional details are not described in order to provide a concise discussion of embodiments.
Reference in the specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in conjunction with the embodiment can be included in at least one embodiment. The appearances of the phrase “in one embodiment” in various places in the specification do not necessarily all refer to the same embodiment. The processes depicted in the figures that follow are performed by processing logic that comprises hardware (e.g. circuitry, dedicated logic, etc.), software, or a combination of both. Although the processes are described below in terms of some sequential operations, it should be appreciated that some of the operations described may be performed in a different order. Moreover, some operations may be performed in parallel rather than sequentially.
A memory management system can manage a memory system that includes at least volatile memory such as DRAM (dynamic random access memory) and a non-volatile memory, such as flash memory or a hard drive or both flash memory and a hard drive in a virtualized memory space. The memory management system can use any one of a variety of ways to reclaim volatile memory, such as DRAM memory including, for example, a reference counting system or other techniques known in the art. In addition, the memory management system can use techniques known in the art that attempt to prevent the free page queue from becoming empty. For example, a technique known or referred to as “Jetsam” can be used to manage memory pressure in order to prevent the free page queue from becoming empty or nearly empty. Examples of such memory management techniques are described in U.S. Pat. No. 7,827,358 and U.S. Publication No. 2012/0179882, both of which are incorporated herein by reference. In addition, the memory management system can use the separate page queues that allow the memory management system to allocate and reclaim memory while keeping track of which pages are free and which pages are actively being used and which pages are inactive. Referring now to
A generalized example of a method according to one embodiment will now be described while referring to
Referring now to
Referring back to
The method shown in
In one embodiment, the memory management system can further integrate a reserved page queue into the flow of pages through the queues shown in
A virtual memory manager VMM 1117 can provide memory management services, such as virtual memory mapping and paging. The operating system 1116 can configure the VMM 1117 to map addresses on the storage devices 1126 into memory, for example, to load binary objects for application software 1112 or system libraries or frameworks 1114, or to store or load compressed and compacted memory to or from a compressed freezer file, according to embodiments described herein.
The exemplary user application software 1112 may be any one of a plurality of user applications, such as a web browser, a document viewer, a picture viewer, a movie player, a word processing or text editing application, an email application, or other applications known in the art. In one embodiment, multiple applications and multiple software daemons can be executing in the background while another application is a foreground application.
The systems and methods described herein can be implemented in a variety of different data processing systems and devices, including general-purpose computer systems, special purpose computer systems, or a hybrid of general purpose and special purpose computer systems. Exemplary data processing systems that can use any one of the methods described herein include desktop computers, laptop computers, tablet computers, smart phones, cellular telephones, personal digital assistants (PDAs), embedded electronic devices, or consumer electronic device.
As shown in
While
It will be apparent from this description that aspects of the present invention may be embodied, at least in part, in software. That is, the techniques may be carried out in a data processing system in response to its processor executing a sequence of instructions contained in a storage medium, such as a non-transitory machine-readable storage medium (e.g., DRAM or flash memory). In various embodiments, hardwired circuitry may be used in combination with software instructions to implement the present invention. Thus the techniques are not limited to any specific combination of hardware circuitry and software, or to any particular source for the instructions executed by the data processing system. Moreover, it will be understood that where mobile or handheld devices are described, the description encompasses mobile devices (e.g., laptop devices, tablet devices), handheld devices (e.g., smartphones), as well as embedded systems suitable for use in wearable electronic devices.
In the foregoing specification, specific exemplary embodiments have been described. It will be evident that various modifications may be made to those embodiments without departing from the broader spirit and scope set forth in the following claims. The specification and drawings are, accordingly, to he regarded in an illustrative sense rather than a restrictive sense.
This application claims the benefit of U.S. Provisional Patent Application No. 62/348,773, filed on Jun. 10, 2016, which application is incorporated herein by reference.
Number | Name | Date | Kind |
---|---|---|---|
6016530 | Auclair et al. | Jan 2000 | A |
6598134 | Ofek et al. | Jul 2003 | B2 |
6639872 | Rein | Oct 2003 | B1 |
6804763 | Stockdale et al. | Oct 2004 | B1 |
7225211 | Colgrove | May 2007 | B1 |
7310699 | Sinclair | Dec 2007 | B2 |
7464222 | Matsunami et al. | Dec 2008 | B2 |
7555575 | Kaneda | Jun 2009 | B2 |
7788220 | Auchmoody et al. | Aug 2010 | B1 |
7827358 | Watson et al. | Nov 2010 | B2 |
7908236 | Modha et al. | Mar 2011 | B2 |
8010747 | Van Riel | Aug 2011 | B2 |
8296510 | Radke et al. | Oct 2012 | B2 |
8463825 | Harty | Jun 2013 | B1 |
8732424 | Lee et al. | May 2014 | B2 |
8751725 | Gangadharan et al. | Jun 2014 | B1 |
9477431 | Chen | Oct 2016 | B1 |
20020104097 | Jerding | Aug 2002 | A1 |
20030005223 | Coulson et al. | Jan 2003 | A1 |
20030056058 | Veitch | Mar 2003 | A1 |
20040044861 | Cavallo et al. | Mar 2004 | A1 |
20040225835 | Coulson | Nov 2004 | A1 |
20050097287 | Melament | May 2005 | A1 |
20070061539 | Nonaka | Mar 2007 | A1 |
20070106842 | Conley et al. | May 2007 | A1 |
20070168627 | In et al. | Jul 2007 | A1 |
20080027905 | Jensen | Jan 2008 | A1 |
20080215834 | Dumitru | Sep 2008 | A1 |
20080275928 | Shuster | Nov 2008 | A1 |
20080288714 | Salomon | Nov 2008 | A1 |
20090089343 | Moore | Apr 2009 | A1 |
20090276588 | Murase | Nov 2009 | A1 |
20100037009 | Yano | Feb 2010 | A1 |
20100082936 | Hobbet et al. | Apr 2010 | A1 |
20100132053 | Chishima | May 2010 | A1 |
20100325352 | Schuette | Dec 2010 | A1 |
20100332725 | Post et al. | Dec 2010 | A1 |
20100332730 | Royer et al. | Dec 2010 | A1 |
20110035548 | Kimmel | Feb 2011 | A1 |
20110082967 | Deshkar et al. | Apr 2011 | A1 |
20110138112 | Chiang et al. | Jun 2011 | A1 |
20110145489 | Yu et al. | Jun 2011 | A1 |
20110153931 | Bell, Jr. | Jun 2011 | A1 |
20110179219 | Ma et al. | Jul 2011 | A1 |
20110185105 | Yano | Jul 2011 | A1 |
20110276744 | Sengupta et al. | Oct 2011 | A1 |
20110283035 | Sutardja | Nov 2011 | A1 |
20110283045 | Krishnan et al. | Nov 2011 | A1 |
20120017043 | Aizman et al. | Jan 2012 | A1 |
20120059972 | Chen | Mar 2012 | A1 |
20120096217 | Son et al. | Apr 2012 | A1 |
20120166749 | Eleftheriou | Jun 2012 | A1 |
20120179882 | Bernhard, III et al. | Jul 2012 | A1 |
20120297117 | Jo | Nov 2012 | A1 |
20130031298 | Tan et al. | Jan 2013 | A1 |
20130046920 | Ryu et al. | Feb 2013 | A1 |
20130060999 | Chiu et al. | Mar 2013 | A1 |
20130080703 | Kumagai et al. | Mar 2013 | A1 |
20130159597 | Cheong | Jun 2013 | A1 |
20130219116 | Wang et al. | Aug 2013 | A1 |
20130226997 | Lee | Aug 2013 | A1 |
20140189281 | Sokol, Jr. | Jul 2014 | A1 |
20140195571 | Wang et al. | Jul 2014 | A1 |
20140267103 | Chaudhri | Sep 2014 | A1 |
20150363311 | Munetoh | Dec 2015 | A1 |
20170010817 | Lim | Jan 2017 | A1 |
20170249174 | Tsirkin | Aug 2017 | A1 |
Number | Date | Country |
---|---|---|
1 492 006 | Oct 2007 | EP |
Entry |
---|
Jiang, Song et al., “CLOCK Pro. An Effective Improvement of the CLOCK Replacement”, In Proceedings of USENIX Annual Conference, (2005), 14 pages. |
Number | Date | Country | |
---|---|---|---|
20170357450 A1 | Dec 2017 | US |
Number | Date | Country | |
---|---|---|---|
62348773 | Jun 2016 | US |