发明名称 Managing object lifetime in a cyclic graph
摘要 The present invention extends to methods, systems, and computer program products for managing object lifetime in a cyclic graph. Embodiments of the invention include reclaiming allocated system resources, for example, from a graph of objects that mixes different resource reclamation techniques (such as reference counting and garbage collection). In response to determining that garbage collection is to be performed, references between GC objects and Ref. Counted objects are detected. A reference type (e.g., direct, indirect, standard, tracked, weakened, etc.) for any detected references is also determined. Garbage collection is performed to determine if any allocated system resources can be reclaimed. Garbage collection considers references and references types between GC objects and Ref. Counted objects when determining if objects are to be reclaimed.
申请公布号 US9613073(B2) 申请公布日期 2017.04.04
申请号 US201514733053 申请日期 2015.06.08
申请人 Microsoft Technology Licensing, LLC 发明人 Hillberg Michael John;Krishnaswamy Raja
分类号 G06F12/00;G06F17/30;G06F12/02 主分类号 G06F12/00
代理机构 Workman Nydegger 代理人 Workman Nydegger
主权项 1. A computer system configured for synchronizing reference information between a counted object graph and a garbage collected object graph in preparation for an attempt to reclaim system resources, the computer system comprising: one or more processors; system memory; and one or more computer readable media having stored thereon computer-executable instructions that are structured such that, when executed, the computer-executable instructions cause the computer system to perform at least the following: calculate references on objects within a cyclic object graph that is stored in the system memory, the cyclic object graph including (i) a counted object graph including one or more reference counted objects having their lifetime managed in accordance with reference counting, and (ii) a garbage collected (“GC”) object graph including one or more GC objects having their lifetime managed in accordance with garbage collection, and in which: a particular reference counted object of the counted object graph references a particular GC object of the GC object graph through a counted wrapper of the counted object graph,the particular GC object references the particular reference counted object through a reference wrapper of the GC object graph,the counted wrapper is reclaimed in accordance with reference counting, and stores a reference from another reference counted object to a further object that is reclaimed in accordance with GC, andthe reference wrapper is reclaimed in accordance with GC, and stores a reference from another GC object to a further object that is reclaimed in accordance with reference counting;prepare for garbage collection, including: (i) determining that the counted wrapper can be reached from the reference wrapper via the counted object graph, (ii) creating a new reference from the reference wrapper to the particular GC object, and (iii) protecting the lifetime of the particular GC object referenced through the counted wrapper and the new reference; andperform the garbage collection to determine if any allocated system resource can be reclaimed from the system memory, garbage collection considering the particular GC object to be effectively referenced by the reference wrapper such that it cannot be reclaimed.
地址 Redmond WA US