Implementing heterogeneous memory within a programming environment
View Patent ↗A computer-implemented method according to one embodiment includes creating a data abstraction that includes a set of memory resources and variables associated with the memory resources. The computer-implemented method also includes implementing the data abstraction within a programming language environment. A system according to another embodiment, includes a processor. The system also includes logic that is integrated with the processor, executable by the processor, or integrated with and executable by the processor. Moreover, the logic is configured to: create a data abstraction that includes a set of memory resources and variables associated with the memory resources. The logic is further configured to: implement the data abstraction within a programming language environment.
1 . A computer-implemented method, comprising:
creating a data abstraction that includes a set of memory resources and variables associated with the memory resources, wherein the memory resources include persistent memory and transient memory, wherein a portion of the persistent memory is configured to function as transient memory;
implementing the data abstraction within a programming language environment; and
creating an object in the data abstraction by:
determining whether a size of the object is above a predetermined threshold, and
creating a construction object in the portion of the persistent memory configured as transient memory in response to determining the size of the object is above the predetermined threshold,
wherein a remaining portion of the persistent memory is divided into partitions,
wherein the partitions of the persistent memory correspond to respective object instances,
wherein the partitions of the persistent memory are managed by independent heap allocators,
wherein the independent heap allocators are configured to implement fine-grained and/or variable length allocations in the respective partitions of the persistent memory,
wherein data and metadata corresponding to the respective variables are included in the data abstraction, wherein implementing the data abstraction within the programming language environment includes:
performing implicit type conversion within the data abstraction to utilize the data abstraction within the programming language environment, and
enabling shadow type instantiation within the programming language environment, and
wherein creating a second object in the data abstraction includes:
creating a shadow object instance in the transient memory, and
using constructor values in the shadow object instance to create the second object in the persistent memory.
2 . The computer-implemented method of claim 1 , comprising in response to determining that an amount of needed memory exceeds a predetermined size threshold, overriding a global allocator to use the portion of the persistent memory for use as transient memory, wherein the global allocator performs coarse-grained allocations of the persistent memory for shelf instances, wherein portions of the persistent memory which correspond to the shelf instances are managed by respective persistent heap allocators.
3 . The computer-implemented method of claim 1 , wherein data and metadata corresponding to the respective variables are included in the data abstraction, wherein creating the object in the data abstraction includes: creating the construction object in the transient memory in response to determining the size of the object is below the predetermined threshold.
4 . The computer-implemented method of claim 1 , wherein the portion of persistent memory in the data abstraction configured as transient memory is managed by an associated persistent heap allocator, wherein the object is created in the data abstraction using the persistent heap allocator.
5 . The computer-implemented method of claim 1 , wherein implementing the data abstraction within the programming language environment includes performing implicit type conversion within the data abstraction to utilize the data abstraction within the programming language environment.
6 . The computer-implemented method of claim 1 , wherein implementing the data abstraction within the programming language environment includes enabling shadow type instantiation within the programming language environment.
7 . The computer-implemented method of claim 1 , wherein implementing the data abstraction within the programming language environment includes enabling crash-consistency within the programming language environment.
8 . A computer program product comprising at least one computer readable storage medium, and program instructions collectively stored on the at least one computer readable storage medium, the program instructions comprising instructions configured to cause one or more processors to perform a method comprising:
creating, by the one or more processors, a data abstraction that includes a set of memory resources and variables associated with the set of memory resources, wherein the set of memory resources includes persistent memory and transient memory, wherein a portion of the persistent memory is configured to function as transient memory;
implementing, by the one or more processors, the data abstraction within a programming language environment; and
creating an object in the data abstraction by:
determining whether a size of the object is above a predetermined threshold, and
creating a construction object in the portion of the persistent memory configured as transient memory in response to determining the size of the object is above the predetermined threshold,
wherein a remaining portion of the persistent memory is divided into partitions,
wherein the partitions of the persistent memory correspond to respective object instances,
wherein the partitions of the persistent memory are managed by independent heap allocators,
wherein the independent heap allocators are configured to implement fine-grained and/or variable length allocations in the respective partitions of the persistent memory,
wherein data and metadata corresponding to the respective variables are included in the data abstraction, wherein implementing the data abstraction within the programming language environment includes:
performing implicit type conversion within the data abstraction to utilize the data abstraction within the programming language environment, and
enabling shadow type instantiation within the programming language environment, and
wherein creating a second object in the data abstraction includes:
creating a shadow object instance in the transient memory, and
using constructor values in the shadow object instance to create the second object in the persistent memory.
9 . The computer program product of claim 8 , wherein data and metadata corresponding to the respective variables are included in and managed by the data abstraction.
10 . The computer program product of claim 8 , wherein the method further comprises:
in response to determining that an amount of memory associated with evaluating an expression exceeds a predetermined threshold, overriding a global allocator of the data abstraction, wherein the global allocator performs coarse-grained allocations of the persistent memory for shelf instances; and
in response to overriding the global allocator, using the portion of the persistent memory as transient memory to evaluate the expression,
wherein a remaining portion of the persistent memory is divided into partitions, wherein the partitions of the persistent memory are managed by independent heap allocators.
11 . The computer program product of claim 8 , wherein implementing the data abstraction within the programming language environment includes performing implicit type conversion within the data abstraction to utilize the data abstraction within the programming language environment.
12 . The computer program product of claim 8 , wherein implementing the data abstraction within the programming language environment includes enabling shadow type instantiation within the programming language environment.
13 . The computer program product of claim 8 , wherein implementing the data abstraction within the programming language environment includes enabling crash-consistency within the programming language environment.
14 . The computer program product of claim 8 , wherein a portion of persistent memory included in the data abstraction is configured to function as transient memory.
15 . The computer program product of claim 8 , wherein the portion of persistent memory in the data abstraction configured to function as transient memory is managed by an associated persistent heap allocator.
16 . A system, comprising:
a processor; and
logic integrated with the processor, executable by the processor, or integrated with and executable by the processor, the logic being configured to:
create a data abstraction that includes a set of memory resources and variables associated with the memory resources, wherein the set of memory resources includes persistent memory and transient memory, wherein a portion of the persistent memory is configured to function as transient memory;
implement the data abstraction within a programming language environment; and
create an object in the data abstraction by:
determining whether a size of the object is above a predetermined threshold, and
creating a construction object in the portion of the persistent memory configured as transient memory in response to determining the size of the object is above the predetermined threshold,
wherein a remaining portion of the persistent memory is divided into partitions,
wherein the partitions of the persistent memory correspond to respective object instances,
wherein the partitions of the persistent memory are managed by independent heap allocators,
wherein the independent heap allocators are configured to implement fine-grained and/or variable length allocations in the respective partitions of the persistent memory,
wherein data and metadata corresponding to the respective variables are included in the data abstraction, wherein implementing the data abstraction within the programming language environment includes:
performing implicit type conversion within the data abstraction to utilize the data abstraction within the programming language environment, and
enabling shadow type instantiation within the programming language environment, and
wherein creating a second object in the data abstraction includes:
creating a shadow object instance in the transient memory, and
using constructor values in the shadow object instance to create the second object in the persistent memory.
17 . The system of claim 16 , wherein data and metadata are included in the data abstraction.
18 . The system of claim 16 , wherein implementing the data abstraction within the programming language environment includes performing implicit type conversion within the data abstraction to utilize the data abstraction within the programming language environment.
19 . The system of claim 16 , wherein the logic is further configured to:
in response to determining that an amount of memory associated with evaluating an expression exceeds a predetermined threshold, overriding a global allocator of the data abstraction, wherein the global allocator performs coarse-grained allocations of the persistent memory for shelf instances, wherein portions of the persistent memory which correspond to the shelf instances are managed by respective persistent heap allocators; and
in response to overriding the global allocator, using the portion of the persistent memory as transient memory to evaluate the expression.