Volatile memories, such as dynamic random access memories (DRAMs) or static random access memories (SRAMs), are commonly used in electronic devices. Unlike non-volatile memories, volatile memories need continuous refreshing, and thus require power, for maintaining data in the memory. However, in portable devices, such as cell phones, laptops and other portable computing devices, it is desirable to reduce power consumption as much as possible to maximize the available “on time.”
Many volatile memories are designed to allow only portions of the memory with data refreshed; this is commonly referred to as a partial array refresh. Conventionally, the focus on RAM systems has been on minimizing the latency of initial access and/or maximizing available RAM. These solutions may be adequate for desktop (or wired) solutions; however, for mobile solutions, reducing power consumption as much as possible is a primary goal.
Accordingly, it would be desirable to further reduce power consumption in managing volatile memory for portable electronic devices where possible.
Aspects, features and advantages of the embodiments of the present invention will become apparent from the following description of the invention in reference to the appended drawing in which like numerals denote like elements and in which:
As volatile memory such as DRAM density increases in today's electronic devices it is more likely to have multiple DRAM chips in a single product. Accordingly, for power-sensitive applications, it would be desirable for a memory management system to be able to optimize the footprint of used memory such that as much of the DRAM as possible could be left without needing to be refreshed so unused memory chips may be powered down entirely when possible.
Various embodiments of the present invention may facilitate one or more of these aspects through a memory management system which, may not simply look for a good fit in memory or store content according to rigid memory area classifications, but allocates memory to minimize the memory area requiring refresh. Additionally, embodiments of the present invention, when freeing memory, may utilize a number of metrics to optimize dynamic packing of the memory.
Turning to
Standard memory mapping may often result in heavily fragmented or non-contiguous storage of content in the physical memory (
By way of contrast, with the example embodiments of the present invention, significant areas of the physical memory (
Likewise, initial, and more temporary content may be placed in areas of the physical memory, for example temporary buffer areas, apart from the longer term content. In this manner, the memory areas including more persistent content gravitate together, and may be continually refreshed, whereas buffer areas and other temporal memory areas such as the heap might not or be powered down entirely.
In certain embodiments, initial physical memory mapping could be performed in a conventional manner (as shown in example (b) of
Accordingly, as used herein the term “mapping” may refer to the initial allocation of memory, the rearrangement of content already present in memory or some combination of both. Further, the term “packing” is broadly used herein to mean that content may be initially placed or rearranged in the physical memory to minimize the footprint in the physical memory.
Turning to
In one or more exemplary embodiments, the likely persistence may be determined 210 by evaluating, for example, age of the content, the owner of the content (e.g., system vs. user), the nature of an application associated with the content, the type of content to be stored (e.g., OS, system files, drivers, user data), and/or any relational attributes in applications/data. If packing is performed for content already stored in memory, the age of the existing content in allocated memory could be observed in determining likelihood of persistence. The skilled artisan would also recognize that various other metrics may be used to optimize the footprint of stored content in the volatile memory.
As previously mentioned the content likely to be most persistent may be mapped 215 and/or stored 220 in substantially contiguous physical blocks of the volatile memory preferably beginning at one side of the physical memory as shown in
Persistent content may alternatively, or in addition, be determined 210 based on one or more descriptors associated with the content. In one example embodiment, content may include one or more descriptors to assist in defining one or more attributes of the content. Such descriptors might be a value which allows the memory management system to know how to treat the content. Example descriptors could be used to quickly identify whether, to compact the content, not to compact the content and/or if it is uncertain how to treat the content. Optimizing the footprint of volatile memory according to the various inventive embodiments may be particularly valuable in multimedia applications having large data sets where, for example, during video encoding or while viewing a movie, a system might utilize large amounts of random access memory (RAM) but during standby, the amount of RAM allocated is significantly less.
Mapping 215 content may include characterizing the likely persistence of the content determined in step 210 and arranging the content in somewhat of a hierarchical order when possible although the inventive embodiments are not limited in this respect. Preferably, more persistent content is mapped 215 in substantially contiguous blocks of the physical memory and less persistent content is mapped 220 is other areas of the physical memory. Thus the fragmentation of physical memory may be reduced due to the deletion of the less persistent content. To this end, application stacks, which tend to be allocated and exist until an application is terminated, might be packed with its associated application as well.
If additional packing criteria, such as periodic timers, change of power saving mode, deletion of data, termination or opening of an application or other event which may affect memory are encountered 225, the packing process may be performed as desired. Additionally, when freeing memory, the memory manager may utilize a number of metrics which evokes optimization or packing. These factors might include for example, processor activity, percentage of memory fragmentation, amount of memory used and the like.
Lastly, depending on the configuration used for partial array refresh or memory power down, power reduction processes or corresponding data for these types of processes may be updated 230 as suitably desired to reflect the used, unused, packed, and unpacked portions of the physical memory resulting from optimization.
Under certain circumstances, packing memory may be very processing intensive and thus it may be desirable to evaluate whether packing could actually consume more power than refreshing underutilized volatile memory areas. Accordingly, one or more power saving thresholds, which might depend on the type and/or size of the volatile memory used, the amount of work vs packing achieved, the amount of time the system is in standby/sleep vs active could be used to determine whether the volatile memory should be packed at all or to what degree the memory should be packed.
Turning to
Memory 320 may be any volatile memory device or plurality of devices for storing content. For example, memory 320 may comprise one or more DRAMs or SRAMs capable of storing at least a portion of an operating system (OS) 324 and/or other applications and/or data for use by CPU 310. OS 324 preferably includes code for virtual memory mapping and maintains a page table for the processes used by CPU 310 to translate virtual memory addresses into physical memory addresses. Memory 320 may also include a loader 326 or dispatcher code for reading or attaching descriptors from/to the content to assist in identifying a packing attribute as previously described.
MMU 330 may be any hardware, software or combination of hardware and software configured to manage the resources of physical memory 320 and perform packing of content as described herein. In certain embodiments, MMU 330 may utilize code from OS 324 and include a page table register to aid hardware to quickly walk page tables in memory and locate pages of running processes. Accordingly, existing operating systems for mobile devices could be modified to implement the dynamic packing described herein without hardware redesign.
System 300 may optionally further include a radio frequency (RF) interface 340 to facilitate wireless communications. RF interface 340 may be configured for cellular telephone, wireless local area network (WLAN) or wireless broadband communications as suitably desired. RF interface 340 may be any component or combination of components adapted to send and receive signals. Preferably, RF interface 340 is adapted to send and receive spread spectrum or OFDM modulated signals, although the embodiments are not limited to any particular modulation scheme or air interface. Various RF interface designs and their operation are known in the art and the description thereof is therefore omitted.
System 300 may be any portable computing or information device, preferably although not necessarily having wireless communication capabilities, such as a cell phone, personal digital assistant, portable computer, personal entertainment device, portable navigation device or other devices where advantages of the inventive embodiments could be suitably applied. Accordingly, the functions and/or specific configurations of system 300 could be modified as desired.
The components and features of system 300 may be implemented using any combination of discrete circuitry, application specific integrated circuits (ASICs), logic gates and/or single chip architectures. Further, the features of system 300 may be implemented using microcontrollers, programmable logic arrays and/or microprocessors or any combination of the foregoing where suitably appropriate.
It should be appreciated that system 300 shown in the block diagram of
Unless contrary to physical possibility, the inventors envision the methods described herein: (i) may be performed in any sequence and/or in any combination; and (ii) the components of respective embodiments may be combined in any manner.
Although there have been described example embodiments of this novel invention, many variations and modifications are possible without departing from the scope of the invention. Accordingly the inventive embodiments are not limited by the specific disclosure above, but rather should be limited only by the scope of the appended claims and their legal equivalents.