Sign In to Follow Application
View All Documents & Correspondence

"Managing Object Lifetime For Native/Managed Peers"

Abstract: A system that manages lifetime of an object is provided. The system analyzes references on multiple objects to determine reach ability of a native peer and dynamically transitions between native and managed object lifetime management systems based on the analysis. When a native peer is not reachable by a native application reference, the system weakens references to a managed peer avoiding memory leaks and clones the native references to the managed side to avoid premature collection. The system performs an optimized cleanup during object system shutdown wherein the references between managed and native peers are released and Safe Handles are suppressed from finalization. The system employs a pending remove list that stores a reference to a weak reference of a managed peer to eliminate race conditions that occur during finalization.

Get Free WhatsApp Updates!
Notices, Deadlines & Correspondence

Patent Information

Application #
Filing Date
29 September 2009
Publication Number
2/2010
Publication Type
INA
Invention Field
COMPUTER SCIENCE
Status
Email
Parent Application
Patent Number
Legal Status
Grant Date
2018-04-12
Renewal Date

Applicants

MICROSOFT CORPORATION.,
ONE MICROSOFT WAY, REDMOND, WASHINGTON 98052-6399

Inventors

1. HILLBERG, MICHAEL J
C/O MICROSOFT CORPORATION, INTERNATIONAL PATENTS, ONE MICROSOFT WAY, REDMOND, WASHINGTON 98052-6399
2. MICHAIL, ASHRAF A
C/O MICROSOFT CORPORATION, INTERNATIONAL PATENTS, ONE MICROSOFT WAY,REDMOND, WASHINGTON 98052-6399
3. PARIKH, SUJAL S
C/O MICROSOFT CORPORATION, INTERNATIONAL PATENTS, ONE MICROSOFT WAY,REDMOND, WASHINGTON 98052-6399

Specification

TECHNICAL FIELD [0001] The subject specification relates generally to memory management in computer systems and more particularly, to a system and methodology that facilitates automated object lifetime management. BACKGROUND [0002] As computer science has evolved, object oriented programming has become one of many familiar models employed by designers and programmers to implement functionality within computer systems. The object model can comprise of one or more objects that act on each other, as opposed to a traditional model that comprises of programs that are a collection of functions, or simply a list of instructions. Each object is capable of receiving messages, processing data, sending messages to other objects and can be viewed as an independent machine with a distinct role or responsibility. [0003] The object lifetime (or life cycle) of an object, in object-oriented programming, is the time between an object's creation (also known as instantiation or construction) and an object's destruction. An object can be created and/or destroyed automatically (such as a managed object) or manually (such as a native or unmanaged object). Managed objects may be described in terms of a data type (e.g., metadata) and automatically collected (e.g., reclaimed) by a managed environment such as a garbage collector that removes the object fi-om memory when the object is no longer being accessed. In contrast, unmanaged objects can be allocated from a standard operating system heap, wherein the object itself is responsible for freeing memory it employs when references to the object no longer exist. This can be accomplished through vi^ell-known techniques such as reference counting, for example. [0004] As described above, managed objects can be allocated from a managed heap and automatically garbage collected. In order to achieve this, references to managed objects can be traced. When a last reference to sm object is removed, the garbage collector can reclaim the memory occupied by the object, mitigating the need to reference count managed objects. Tracing is possible within managed code because the managed environment can keep frack of outstanding references that exist on an object. As each new object reference is declared within managed code, the managed environment can add the reference to a list of live references. At any given time, the managed environment, rather than the object itself, can thus be aware of live references that exist on a given object. As references fall out of scope or change value, the list of live references can be updated, and as long as a reference remains within managed code, the managed environment can trace it. [0005] The implementation of an object can be split across a native part and a managed part (peers). The native peer's lifetime can be controlled with a reference counting technique whereas the garbage collector, as discussed above, can manage the managed peer's lifetime. When some of the references between managed objects go through native code, the managed objects can be leaked or pre-maturely collected. [0006] In multiple managed/native object pair scenarios, as long as a reference to either of the objects exists, the pair must live. Traditional solutions require multiple garbage collections to reclaim the objects and are prone to memory leaks, wherein the objects do not get collected even though there are no external references to the objects, and premature collection, wherein the garbage collector reclaims the objects even though an unmanaged reference may exist. SUMMARY [0007] The following presents a simplified summary of the specification in order to provide a basic understanding of some aspects of the specification. This summary is not an extensive overview of the specification. It is intended to neither identify key or critical elements of the specification nor delineate the scope of the specification. Its sole purpose is to present some concepts of the specification in a simplified form as a prelude to the more detailed description that is presented later. [0008] The system disclosed and claimed herein, in one aspect thereof, facilitates management of the lifetime of an object. The system allows transitioning between object lifetime management systems on the native side, such as a reference counting system, and on the managed side, such as a garbage collection system. In certain phases, the system employs the reference counting system to control lifetime of an object pair whereas in other phases the system turns the lifetime control over to the garbage collection system, in a manner that is transparent to the programmer and/or end user. The system can determine lifetime of an object by dynamically switching between two lifetime management systems based on an analysis of references (direct or indirect) to the object. [0009] According to an aspect of the system, a reference counting component employs a reference counting technique to calculate the references on each object. The reference counting component determines the total number of references on each native object peer and accordingly assigns a reference count to each native object peer. An analysis component analyzes references on a native object. In addition, the analysis component weakens and/or strengthens the references between object peers based on the analysis to avoid memory leaks. A weak reference is a reference to a managed object that does not prevent the managed object from being garbage collected such that a managed object is collectable if there are no sfrong references to it. Furthermore, once references are weakened, the analysis component duplicates intra native references to the managed side based on the reference analysis and prevents premature collection. The analysis component can facilitate the transitioning of lifetime management from a reference counting system to a garbage collection system and back. [0010] According to yet another aispect of the system, when external references do not exist on the native side in multiple object pairs, the references from a native peer to a managed peer are weakened. Wealcening references to managed peers within a sub tree allows the managed peers to be collected when managed references to the peers are dropped/removed. Once the references to the managed peers are weakened, the system clones the native references to the managed side and avoids premature collection. If a new external (direct and/or indirect) native reference is made to a native peer, the references to managed peers within the sub free are made strong again. [0011] One aspect of the system relates to an optimization component that is employed to release references between managed and native peers and/or suppress SafeHandles from finalization. Typically, a SafeHandle is a managed object that holds a reference to a native object. When managed objects are collected, a finalization mechanism is employed that performs final processing during garbage collection of a managed object. When the SafeHandle is garbage collected, its finalization step releases its reference on the native peer .The optimization component described leverages the domain specific properties of the system to derive a set of static rules for deciding when to sfrengthen/weaken references. Furthermore, in accordance with an Jispect of the system, if a managed peer carries no state, the optimization component keeps a weak reference on it. [0012] Yet another aspect of the vSystem relates to a pending remove list for references that is employed to avoid race conditions. When a managed peer is garbage collected, a reference to weak reference object is kept in a pending remove list imtil a SafeHandle for that peer is finalized. An object can be finalized at any point in time after it has been collected. This allows the managed peer to be recreated if necessary before the finalizer has run. [0013] The following description and the annexed drawings set forth certain illusfrative aspects of the specification. These aspects are indicative, however, of but a few of the various ways in which the principles of the specification may be employed. Other advantages and novel features of the specification will become apparent from the following detailed description of the specification when considered in conjunction with the drawings. BRIEF DESCRIPTION OF THE DRAWINGS [0014] FIG. 1 illustrates a block diagram of an exemplary system that facilitates object lifetime management. [0015] FIG. 2 illustrates an exemplary scenario wherein an object is split between a managed side and a native side according to one aspect of the specification. [0016] FIG. 3 illustrates an exemplary scenario wherein references to a managed peer are weakened according to an aspect of the specification. [0017] FIG. 4A- 4D illustrate an exemplary garbage collection mechanism for multiple object pairs. [0018] FIG. 5 A-B illustrate an ex

Documents

Orders

Section Controller Decision Date

Application Documents

# Name Date
1 5702-CHENP-2009-RELEVANT DOCUMENTS [15-09-2023(online)].pdf 2023-09-15
1 abs 5702-chenp-2009 abstract 29-09-2009.jpg 2009-09-29
2 5702-chenp-2009 power of attorney 29-09-2009.pdf 2009-09-29
2 5702-CHENP-2009-RELEVANT DOCUMENTS [26-09-2022(online)].pdf 2022-09-26
3 5702-CHENP-2009-RELEVANT DOCUMENTS [23-09-2021(online)].pdf 2021-09-23
3 5702-chenp-2009 pct search report 29-09-2009.pdf 2009-09-29
4 5702-CHENP-2009-RELEVANT DOCUMENTS [27-03-2020(online)].pdf 2020-03-27
4 5702-chenp-2009 pct 29-09-2009.pdf 2009-09-29
5 5702-CHENP-2009-RELEVANT DOCUMENTS [29-05-2019(online)].pdf 2019-05-29
5 5702-chenp-2009 form-5 29-09-2009.pdf 2009-09-29
6 5702-CHENP-2009-RELEVANT DOCUMENTS [28-03-2019(online)].pdf 2019-03-28
6 5702-chenp-2009 form-3 29-09-2009.pdf 2009-09-29
7 5702-CHENP-2009-RELEVANT DOCUMENTS [21-03-2019(online)].pdf 2019-03-21
7 5702-chenp-2009 form-2 29-09-2009.pdf 2009-09-29
8 5702-CHENP-2009-IntimationOfGrant12-04-2018.pdf 2018-04-12
8 5702-chenp-2009 form-1 29-09-2009.pdf 2009-09-29
9 5702-chenp-2009 drawings 29-09-2009.pdf 2009-09-29
9 5702-CHENP-2009-PatentCertificate12-04-2018.pdf 2018-04-12
10 5702-chenp-2009 description (complete) 29-09-2009.pdf 2009-09-29
10 Abstract_Granted 295711_12-04-2018.pdf 2018-04-12
11 5702-chenp-2009 correspondence others 29-09-2009.pdf 2009-09-29
11 Claims_Granted 295711_12-04-2018.pdf 2018-04-12
12 5702-chenp-2009 claims 29-09-2009.pdf 2009-09-29
12 Description_Granted 295711_12-04-2018.pdf 2018-04-12
13 5702-chenp-2009 assignment 29-09-2009.pdf 2009-09-29
13 Drawings_Granted 295711_12-04-2018.pdf 2018-04-12
14 5702-chenp-2009 abstract 29-09-2009.pdf 2009-09-29
14 Marked Up Claims_Granted 295711_12-04-2018.pdf 2018-04-12
15 5702-CHENP-2009 ASSIGNMENT 20-10-2009.pdf 2009-10-20
15 5702-CHENP-2009-Written submissions and relevant documents (MANDATORY) [07-03-2018(online)].pdf 2018-03-07
16 5702-chenp-2009 form-3 29-03-2010.pdf 2010-03-29
16 Correspondence by Agent_Power of Authorisation_22-02-2018.pdf 2018-02-22
17 5702-CHENP-2009-FORM-26 [20-02-2018(online)].pdf 2018-02-20
17 5702-chenp-2009 form-18 29-03-2011.pdf 2011-03-29
18 5702-chenp-2009 correspondence others 29-03-2011.pdf 2011-03-29
18 5702-CHENP-2009-HearingNoticeLetter.pdf 2018-02-02
19 5702-CHENP-2009 FORM-6 25-02-2015.pdf 2015-02-25
19 5702-CHENP-2009-CLAIMS [12-12-2017(online)].pdf 2017-12-12
20 5702-CHENP-2009-COMPLETE SPECIFICATION [12-12-2017(online)].pdf 2017-12-12
20 MTL-GPOA - KONPAL.pdf ONLINE 2015-03-05
21 5702-CHENP-2009-CORRESPONDENCE [12-12-2017(online)].pdf 2017-12-12
21 MS to MTL Assignment.pdf ONLINE 2015-03-05
22 5702-CHENP-2009-FER_SER_REPLY [12-12-2017(online)].pdf 2017-12-12
22 FORM-6-1301-1400(KONPAL).49.pdf ONLINE 2015-03-05
23 5702-CHENP-2009-OTHERS [12-12-2017(online)].pdf 2017-12-12
23 MTL-GPOA - KONPAL.pdf 2015-03-13
24 MS to MTL Assignment.pdf 2015-03-13
24 5702-CHENP-2009-FER.pdf 2017-07-13
25 FORM-6-1301-1400(KONPAL).49.pdf 2015-03-13
26 5702-CHENP-2009-FER.pdf 2017-07-13
26 MS to MTL Assignment.pdf 2015-03-13
27 5702-CHENP-2009-OTHERS [12-12-2017(online)].pdf 2017-12-12
27 MTL-GPOA - KONPAL.pdf 2015-03-13
28 5702-CHENP-2009-FER_SER_REPLY [12-12-2017(online)].pdf 2017-12-12
28 FORM-6-1301-1400(KONPAL).49.pdf ONLINE 2015-03-05
29 5702-CHENP-2009-CORRESPONDENCE [12-12-2017(online)].pdf 2017-12-12
29 MS to MTL Assignment.pdf ONLINE 2015-03-05
30 5702-CHENP-2009-COMPLETE SPECIFICATION [12-12-2017(online)].pdf 2017-12-12
30 MTL-GPOA - KONPAL.pdf ONLINE 2015-03-05
31 5702-CHENP-2009 FORM-6 25-02-2015.pdf 2015-02-25
31 5702-CHENP-2009-CLAIMS [12-12-2017(online)].pdf 2017-12-12
32 5702-chenp-2009 correspondence others 29-03-2011.pdf 2011-03-29
32 5702-CHENP-2009-HearingNoticeLetter.pdf 2018-02-02
33 5702-chenp-2009 form-18 29-03-2011.pdf 2011-03-29
33 5702-CHENP-2009-FORM-26 [20-02-2018(online)].pdf 2018-02-20
34 5702-chenp-2009 form-3 29-03-2010.pdf 2010-03-29
34 Correspondence by Agent_Power of Authorisation_22-02-2018.pdf 2018-02-22
35 5702-CHENP-2009-Written submissions and relevant documents (MANDATORY) [07-03-2018(online)].pdf 2018-03-07
35 5702-CHENP-2009 ASSIGNMENT 20-10-2009.pdf 2009-10-20
36 Marked Up Claims_Granted 295711_12-04-2018.pdf 2018-04-12
36 5702-chenp-2009 abstract 29-09-2009.pdf 2009-09-29
37 5702-chenp-2009 assignment 29-09-2009.pdf 2009-09-29
37 Drawings_Granted 295711_12-04-2018.pdf 2018-04-12
38 5702-chenp-2009 claims 29-09-2009.pdf 2009-09-29
38 Description_Granted 295711_12-04-2018.pdf 2018-04-12
39 5702-chenp-2009 correspondence others 29-09-2009.pdf 2009-09-29
39 Claims_Granted 295711_12-04-2018.pdf 2018-04-12
40 5702-chenp-2009 description (complete) 29-09-2009.pdf 2009-09-29
40 Abstract_Granted 295711_12-04-2018.pdf 2018-04-12
41 5702-chenp-2009 drawings 29-09-2009.pdf 2009-09-29
41 5702-CHENP-2009-PatentCertificate12-04-2018.pdf 2018-04-12
42 5702-chenp-2009 form-1 29-09-2009.pdf 2009-09-29
42 5702-CHENP-2009-IntimationOfGrant12-04-2018.pdf 2018-04-12
43 5702-chenp-2009 form-2 29-09-2009.pdf 2009-09-29
43 5702-CHENP-2009-RELEVANT DOCUMENTS [21-03-2019(online)].pdf 2019-03-21
44 5702-chenp-2009 form-3 29-09-2009.pdf 2009-09-29
44 5702-CHENP-2009-RELEVANT DOCUMENTS [28-03-2019(online)].pdf 2019-03-28
45 5702-chenp-2009 form-5 29-09-2009.pdf 2009-09-29
45 5702-CHENP-2009-RELEVANT DOCUMENTS [29-05-2019(online)].pdf 2019-05-29
46 5702-CHENP-2009-RELEVANT DOCUMENTS [27-03-2020(online)].pdf 2020-03-27
46 5702-chenp-2009 pct 29-09-2009.pdf 2009-09-29
47 5702-CHENP-2009-RELEVANT DOCUMENTS [23-09-2021(online)].pdf 2021-09-23
47 5702-chenp-2009 pct search report 29-09-2009.pdf 2009-09-29
48 5702-CHENP-2009-RELEVANT DOCUMENTS [26-09-2022(online)].pdf 2022-09-26
48 5702-chenp-2009 power of attorney 29-09-2009.pdf 2009-09-29
49 abs 5702-chenp-2009 abstract 29-09-2009.jpg 2009-09-29
49 5702-CHENP-2009-RELEVANT DOCUMENTS [15-09-2023(online)].pdf 2023-09-15
50 5702-CHENP-2009-FORM-27 [11-09-2025(online)].pdf 2025-09-11

Search Strategy

1 searchstrategy_29-06-2017.pdf

ERegister / Renewals

3rd: 21 Jun 2018

From 26/03/2010 - To 26/03/2011

4th: 21 Jun 2018

From 26/03/2011 - To 26/03/2012

5th: 21 Jun 2018

From 26/03/2012 - To 26/03/2013

6th: 21 Jun 2018

From 26/03/2013 - To 26/03/2014

7th: 21 Jun 2018

From 26/03/2014 - To 26/03/2015

8th: 21 Jun 2018

From 26/03/2015 - To 26/03/2016

9th: 21 Jun 2018

From 26/03/2016 - To 26/03/2017

10th: 21 Jun 2018

From 26/03/2017 - To 26/03/2018

11th: 21 Jun 2018

From 26/03/2018 - To 26/03/2019

12th: 14 Feb 2019

From 26/03/2019 - To 26/03/2020

13th: 07 Feb 2020

From 26/03/2020 - To 26/03/2021

14th: 08 Feb 2021

From 26/03/2021 - To 26/03/2022

15th: 08 Feb 2022

From 26/03/2022 - To 26/03/2023

16th: 09 Feb 2023

From 26/03/2023 - To 26/03/2024

17th: 20 Mar 2024

From 26/03/2024 - To 26/03/2025