Patent ID: 9141540
Filing Date: 2015-09-22
Classification: G06F

Abstract:
1. A method for a garbage-collected interned string table, comprising: creating reference objects that each reference at least one of the strings in the interned string table; marking the reference objects with a current generation; marking the strings referenced by the reference objects in the interned string table with the current generation, wherein each of the strings is marked with a generation that is a same generation as that of a reference object that last referenced that string; and performing garbage collection by: advancing the current generation to a next generation; in response to the reference objects in a previous generation from the current generation advancing to an acquired references state in which the reference object can not obtain new references to the strings, promoting the reference objects and the strings referenced by the reference objects in the previous generation to the current generation; determining whether an ephemeral reference object has been created that serves as a token to hold off the garbage collection of the previous generation; in response to determining that the ephemeral reference object has been created, holding off on deleting all of the strings that are marked with the previous generation in the interned string table until the ephemeral reference object has been unregistered; and in response to determining that the ephemeral reference object has not been created, deleting the strings that are marked with the previous generation in the interned string table.