发明名称 Non-precise garbage collection in non-cooperative systems
摘要 Embodiments are directed towards garbage collection for an application running on a non-cooperative target platform. Where the garbage collection optimistically manages thread state for transitions to and from native and managed code and that some threads are suspended while others are left executing during garbage collection. When a characteristic of the native code call indicates that a duration of the native code call may exceed a defined duration, state information for the thread may be updated to transition the thread to the unmanaged code environment. When a garbage collection event occurs, thread state information is updated to communicate suspend requests to the threads. Then the runtime may wait for each thread in the managed code environment to be reach a safe state before garbage collection may commence.
申请公布号 US9032410(B1) 申请公布日期 2015.05.12
申请号 US201414463440 申请日期 2014.08.19
申请人 Xamarin Inc. 发明人 Kumpera Rodrigo;de Icaza Miguel
分类号 G06F12/00;G06F12/02;G06F9/48 主分类号 G06F12/00
代理机构 Lowe Graham Jones PLLC 代理人 Branch John W.;Lowe Graham Jones PLLC
主权项 1. A method for managing memory for an application using a computer, wherein the computer performs actions, including: when at least one thread of a plurality of threads encounters a native code call during the execution of the application in a managed code environment, further actions are performed, including: determining at least one characteristic of the native code call based in part on configuration information that is associated with a target platform for the application;when the at least one characteristic of the native code call indicates that a duration of the native code call exceeds a defined duration threshold, updating at least state information for the at least one thread to at least indicate that the at least one thread is executing in an unmanaged code environment; andwhen the native code call completes, updating the state information for the at least one thread to at least indicate that the at least one thread is executing in the managed code environment; and when a garbage collection event occurs, further actions are performed, including: updating state information for each of the plurality of threads to communicate a suspend request to the plurality of threads;waiting for each thread of the plurality of threads that is executing in the managed code environment to become safe for garbage collection; andwhen each thread in the managed code environment is safe for garbage collection, executing one or more garbage collection actions to manage the memory for the application.
地址 San Francisco CA US