Computer system with heap and card table
First Claim
1. A method of operating a computer system having a memory, a portion of which is allocated to a heap for storing objects, said method comprising the steps of:
- providing a card table comprising a set of N cards;
dividing the entire memory into M segments each segment having a segment size S, in which X of the M segments corresponds to the heap, where M>
N and N>
=X;
assigning each of the M segments to a corresponding one of said N cards, wherein at least one of said cards has multiple memory segments assigned to said card;
mapping the mth memory segment (0=>
m=>
M−
1) to a card C where C=(m mod N)/S wherein M, N, X, C, S and m are integers; and
marking a card to indicate an update to one of the one or more memory segments that correspond to the marked card.
1 Assignment
0 Petitions
Accused Products
Abstract
A computer system has a heap for storing objects and a card table for tracking updates to objects on the heap, typically for garbage collection purposes. In particular, the heap is divided into segments, each corresponding to a card in the card table, and any update to a segment in the heap triggers a write barrier to mark the corresponding card in the card table. It is important that this write barrier is as efficient as possible to optimize system performance. In some circumstances an object update may be made to an address outside the heap. To ensure that this still properly maps to a card in the card table, the entire memory space is folded cyclically, so that any given memory address corresponds to one, and only one card, in the card table.
30 Citations
27 Claims
-
1. A method of operating a computer system having a memory, a portion of which is allocated to a heap for storing objects, said method comprising the steps of:
-
providing a card table comprising a set of N cards;
dividing the entire memory into M segments each segment having a segment size S, in which X of the M segments corresponds to the heap, where M>
N and N>
=X;
assigning each of the M segments to a corresponding one of said N cards, wherein at least one of said cards has multiple memory segments assigned to said card;
mapping the mth memory segment (0=>
m=>
M−
1) to a card C where C=(m mod N)/S wherein M, N, X, C, S and m are integers; and
marking a card to indicate an update to one of the one or more memory segments that correspond to the marked card. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A computer system comprising:
-
a memory, a portion of which is allocated to a heap for storing objects, the entire memory being divided into M segments each segment having a segment size S, in which X segments correspond to the heap;
a card table comprising a set of N cards, wherein M>
N and N>
X, each of the M segments being assigned to a corresponding one of said N cards, so that at least one of said cards has multiple memory segments assigned to said card;
means for mapping the mth memory segment (0=>
m =>
M−
1) to a card C where C=(m mod N)/S;
wherein M, N, X, C, S and m are integers; and
a write barrier for marking a card to indicate an update to one of the one or more memory segments that correspond to the marked card. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A computer program product comprising program instructions encoded in a machine readable format on a storage medium, said instructions when loaded into a computer system having a memory, a portion of which is allocated to a heap for storing objects, causing the computer system to perform the steps of:
-
providing a card table comprising a set of N cards;
dividing the entire memory into M segments each segment having a segment size S, of which X segments represent the heap, where M>
N and N>
=X;
assigning each of the M segments to a corresponding one of said N cards, wherein at least one of said cards has multiple memory segments assigned to said card;
mapping the mth memory segment (0=>
m=>
M−
1) to a card C, where C=(m mod N)/S, wherein M, N, X, C, S and m are integers; and
marking a card to indicate an update to one of the one or more memory segments that correspond to the marked card. - View Dependent Claims (20, 21, 22, 23, 24, 25, 26, 27)
-
Specification