Method and system for selective memory coalescing across memory heap boundaries
First Claim
1. A method for selected memory coalescing across memory heap boundaries in a computer system having a plurality of allocated memory heaps, said method comprising the steps of:
- maintaining an identification of an allocated memory heap containing a preceding adjacent block of memory and an identification of an allocated memory heap containing a succeeding adjacent block of memory for each block of memory within said plurality of allocated memory heaps;
determining a usage state of both a preceding adjacent block of memory and a succeeding adjacent block of memory in response to a freeing of a selected block of memory;
temporarily locking access to only those allocated memory heaps containing a free preceding or a free succeeding adjacent block of memory for said selected block of memory;
coalescing said selected block of memory with a free preceding adjacent block of memory and/or a free succeeding adjacent block of memory;
updating said maintained identification of allocated memory heaps containing said preceding adjacent block of memory and said succeeding adjacent block of memory to reflect said coalescing; and
releasing said temporarily locked access.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and system for efficient coalescing of memory blocks across memory heap boundaries in multiprocessor or multithread computer system. Blocks of memory are allocated into multiple heaps for exclusive utilization by separate processors or processes. Varying memory requirements result in fragmentation and increased memory utilization over time and coalescing of memory is necessary. An identification of each memory heap which contains a preceding adjacent memory block and a succeeding adjacent memory block is maintained for all memory blocks. Thereafter, each time a memory block is freed it may be coalesced across heap boundaries with an adjacent preceding or succeeding memory block by temporarily locking access to only those memory heaps containing a free preceding or succeeding adjacent memory block.
-
Citations
15 Claims
-
1. A method for selected memory coalescing across memory heap boundaries in a computer system having a plurality of allocated memory heaps, said method comprising the steps of:
-
maintaining an identification of an allocated memory heap containing a preceding adjacent block of memory and an identification of an allocated memory heap containing a succeeding adjacent block of memory for each block of memory within said plurality of allocated memory heaps;
determining a usage state of both a preceding adjacent block of memory and a succeeding adjacent block of memory in response to a freeing of a selected block of memory;
temporarily locking access to only those allocated memory heaps containing a free preceding or a free succeeding adjacent block of memory for said selected block of memory;
coalescing said selected block of memory with a free preceding adjacent block of memory and/or a free succeeding adjacent block of memory;
updating said maintained identification of allocated memory heaps containing said preceding adjacent block of memory and said succeeding adjacent block of memory to reflect said coalescing; and
releasing said temporarily locked access. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A system for selected memory coalescing across memory heap boundaries in a computer system having a plurality of allocated memory heaps, said system comprising:
-
means for maintaining an identification of an allocated memory heap containing a preceding adjacent block of memory and an identification of an allocated memory heap containing a succeeding adjacent block of memory for each block of memory within said plurality of allocated memory heaps;
means for determining a usage state of both a preceding adjacent block of memory and a succeeding adjacent block of memory in response to a freeing of a selected block of memory;
means for temporarily locking access to only those allocated memory heaps containing a free preceding or a free succeeding adjacent block of memory for said selected block of memory;
means for coalescing said selected block of memory with a free preceding adjacent block of memory and/or a free succeeding adjacent block of memory;
means for updating said maintained identification of allocated memory heaps containing said preceding adjacent block of memory and said succeeding adjacent block of memory to reflect said coalescing; and
means for releasing said temporarily locked access. - View Dependent Claims (7, 8, 9, 10)
-
-
11. A computer program product for selected memory coalescing across memory heap boundaries in a computer system having a plurality of allocated memory heaps, said computer program product comprising:
-
computer readable media;
instruction means embodied within said computer readable media for maintaining an identification of an allocated memory heap containing a preceding adjacent block of memory and an identification of an allocated memory heap containing a succeeding adjacent block of memory for each block of memory within said plurality of allocated memory heaps;
instruction means embodied within said computer readable media for determining a usage state of both a preceding adjacent block of memory and a succeeding adjacent block of memory in response to a freeing of a selected block of memory;
instruction means embodied within said computer readable media for temporarily locking access to only those allocated memory heaps containing a free preceding or a free succeeding adjacent block of memory for said selected block of memory;
instruction means embodied within said computer readable media for coalescing said selected block of memory with a free preceding adjacent block of memory and/or a free succeeding adjacent block of memory;
instruction means embodied within said computer readable media for updating said maintained identification of allocated memory heaps containing said preceding adjacent block of memory and said succeeding adjacent block of memory to reflect said coalescing; and
instructions means embodied within said computer readable media for releasing said temporarily locked access. - View Dependent Claims (12, 13, 14, 15)
-
Specification