IP Library › Granted Patent US 12,645,491
Granted Patent B2
US 12,645,491 · App. 18/574,353 · Granted Jun 2, 2026

Techniques for clearing the internal state of a library

Inventors: Moshe Chocron (Ashdod, IL); Alexander Winokur (Ramat Gan, IL)
Assignee: HYPERPLANE LTD.
G06F9/4862G06F2209/509
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,645,491
App. No.
18/574,353
Granted
Jun 2, 2026
Kind
B2
Abstract

A method, including receiving a request to migrate an executing application ( 34 ) that includes a library ( 42 ) having functions ( 46 ) configured to generate a log ( 92 ) tracking library resources ( 106 ). Upon suspending the application while the library has a current state ( 160 ), the library is unloaded from memory ( 24 ), and upon unloading the library, any pending resources allocated to the library are identified. The identified resources are deallocated so as to define a cleaned version of the application that does not include any of the allocated resources, and the cleaned version of the application is migrated to a destination machine ( 180 ). Execution of the migrated application is resumed on the destination machine so as to link the migrated application to an additional instance of the library, and the log is replayed so as to bring the linked additional instance of the library on the destination machine to the current state.

Claims (44)

1 . A method, comprising:

receiving, by a first machine, a request to migrate an application that is executing in a memory of the first machine, wherein the application comprises a first instance of a dynamic library having one or more functions;

generating a log comprising resources allocated to and deallocated from the first instance of the dynamic library in response to executing the application, wherein generating the log comprises recording, by a set of wrapped system library functions, calls from the first instance of the dynamic library to system library functions that allocate and deallocate resources;

suspending execution of the application while the first instance of the dynamic library has a current state;

unloading the first instance of the dynamic library from the memory;

identifying, subsequent to unloading the first instance of the dynamic library, any of the resources that were allocated to the first instance of the dynamic library and that are still pending;

deallocating the identified resources so as to define a cleaned version of the application that does not comprise any of the allocated resources;

migrating the cleaned version of the application to a second machine;

resuming execution of the application on the second machine so as to link the application to a second instance of the dynamic library; and

replaying the log so as to bring the linked second instance of the dynamic library on the second machine to the current state.

2 . The method according to claim 1 , wherein the first instance of the dynamic library controls a stateful hardware peripheral.

3 . The method according to claim 2 , wherein the stateful hardware peripheral comprises a hardware accelerator.

4 . The method according to claim 3 , wherein the hardware accelerator comprises a Graphics Processing Unit (GPU) having a GPU memory.

5 . The method according to claim 4 , wherein the source machine comprises a first GPU, wherein the second machine comprises a second GPU, wherein migrating the cleaned version of the application comprises copying data stored in the GPU memory of the first GPU to the GPU memory of the second GPU, and wherein the current state comprises the data stored in the GPU memory of the first GPU.

6 . The method according to claim 2 , wherein the current state comprises a current software state, wherein the first machine comprises a first stateful hardware having a current hardware state upon suspending the application, wherein the second machine comprises a second stateful hardware, and wherein replaying the logs brings the second stateful hardware to the current hardware state.

7 . The method according to claim 1 , wherein a given resource comprises a heap memory allocation, and wherein the current state comprises the heap memory allocation and data stored in the allocated heap memory.

8 . The method according to claim 1 , wherein a given resource comprises a dynamic memory allocation, and wherein the current state comprises the dynamic memory allocation and data stored in dynamically allocated memory.

9 . The method according to claim 1 , wherein a given resource comprises a currently allocated device handle, and wherein the current state comprises the currently allocated device handle.

10 . The method according to claim 1 , wherein a given resource comprises a currently allocated file handle, and wherein the current state comprises the currently allocated file handle.

11 . The method according to claim 1 , wherein a given resource comprises a thread, and wherein the current state comprises the thread.

12 . The method according to claim 1 , wherein a given resource comprises a lock, and wherein the current state comprises the lock.

13 . The method according to claim 1 , wherein the application comprises a set of wrapper functions that call the functions in the first instance of the dynamic library.

14 . The method according to claim 13 , wherein suspending the application comprises suspending the application upon detecting that none of the wrapper functions are currently executing.

15 . The method according to claim 1 , wherein identifying the resources comprises recording a first state of the resources prior to loading the dynamic library, recording a second state of the resources upon loading the dynamic library, recording a third state of the resources upon suspending execution of the application, recording a fourth state of the resources upon unloading the dynamic library, wherein the fourth state of the resources comprises log entries in the log comprising resource allocations and deallocations between second and third state, and analyzing the first, the second, the third, the fourth recorded states.

16 . The method according to claim 15 , wherein recording a given state comprises generating a list of the resources.

17 . The method according to claim 15 , wherein recording the second state comprises computing a difference in the resource allocations between the first and the second recorded states, wherein recording the third state comprises adding, to the computed difference, the resource allocations recorded in the log, and wherein recording the fourth state comprises computing a difference in resource allocations between the third recorded state unloading the first instance of the library, and subtracting the difference from resources allocated in the third recorded state.

18 . The method according to claim 1 , wherein the resources that are still pending comprise the resources that are still in the memory, and wherein deallocating the identified resources comprises deallocating the identified resources from the memory.

19 . A source computer, comprising:

a memory; and

one or more processors configured

to receive a request to migrate an application that is executing in the memory of the source computer, wherein the application comprises a first instance of a dynamic library having one or more functions,

to generate a log comprising resources allocated to and deallocated from the first instance of the dynamic library in response to executing the application, wherein generating the log comprises recording, by a set of wrapped system library functions, calls from the first instance of the dynamic library to system library functions that allocate and deallocate resources,

to suspend execution of the application while the first instance of the dynamic library has a current state, to unload the first instance of the dynamic library from the memory,

to identify, subsequent to unloading the first instance of the dynamic library, any of the resources that were allocated to the first instance of the dynamic library and that are still pending,

to deallocate the identified resources so as to define a cleaned version of the application that does not comprise any of the allocated resources, and

to migrate the cleaned version of the application to a destination computer, so that upon the destination computer resuming execution of the application and linking the application on the destination computer to a second instance of the dynamic library, the destination computer replays the log so as to bring the linked second instance of the dynamic library to the current state.

20 . A computer software product for controlling operation of a computer, comprising a non-transitory computer-readable medium, in which program instructions are stored, which instructions, when read by a computer, cause the computer:

to receive, by a first machine, a request to migrate an application that is executing in a memory of the first machine, wherein the application comprises a first instance of a dynamic library having one or more functions;

to generate a log comprising resources allocated to and deallocated from the first instance of the dynamic library in response to executing the application, wherein generating the log comprises recording, by a set of wrapped system library functions, calls from the first instance of the dynamic library to system library functions that allocate and deallocate resources;

to suspend execution of the application while the first instance of the dynamic library has a current state;

to unload the first instance of the dynamic library from the memory;

to identify, subsequent to unloading the first instance of the dynamic library, any of the resources that were allocated to the first instance of the dynamic library and that are still pending;

to deallocate the identified resources so as to define a cleaned version of the application that does not comprise any of the allocated resources; and

to migrate the cleaned version of the application to a destination machine, so that upon the destination machine resuming execution of the application and linking the application on the destination machine to a second instance of the dynamic library, the destination machine replays the log so as to bring the linked second instance of the dynamic library to the current state.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 27, 2023
From: CHOCRON, MOSHE; WINOKUR, ALEXANDER
To: HYPERPLANE LTD.
Reel/Frame 065959/0268 →
Continuity (2)
Provisional Application 63243221 · Sep 13, 2021
Related Publication 20240289164A1 · Aug 29, 2024
References Cited (32)
US 8595271B1 · Patwardhan · 2013 [cited by examiner]
US 10649790B1 · Ingegneri · 2020 [cited by examiner]
US 10868825B1 · Dominessy · 2020 [cited by examiner]
US 20160110359A1 · Underwood · 2016 [cited by examiner]
US 20160247248A1 · Ha · 2016 [cited by examiner]
US 20170093988A1 · Rehaag · 2017 [cited by examiner]
US 20170308449A1 · Mangione-Tran · 2017 [cited by examiner]
US 20180217836A1 · Johnson · 2018 [cited by examiner]
US 20190121662A1 · Zhao et al. · 2019 [cited by applicant]
US 20190213032A1 · Eyal · 2019 [cited by examiner]
US 20190361750A1 · Sequeira · 2019 [cited by examiner]
US 20200034167A1 · Parthasarathy et al. · 2020 [cited by applicant]
US 20200201648A1 · Memon · 2020 [cited by examiner]
US 20200364240A1 · Martin · 2020 [cited by examiner]
US 20210232441A1 · Lee · 2021 [cited by examiner]
US 20210303327A1 · Vu · 2021 [cited by examiner]
US 20220012087A1 · Zheng et al. · 2022 [cited by applicant]
US 20220197811A1 · Ganguly · 2022 [cited by examiner]
WO WO2020192448A1 · 2020 [cited by examiner]
Boehm, “Software Engineering,” IEEE Transactions on Computers, vol. C-25, No. 12, pp. 1226-1241, Dec. 1976. [cited by applicant]
Nvidia Corporation, “CUDA Runtime API-CUDA Toolkit Documentation,” p. 1-619, Aug. 2021. [cited by applicant]
Nvidia Corporation, “CUDA C++ Programming Guide,” pp. 1-420, Aug. 2021, as downloaded from https://web.archive.org/web/20210908205243/https://docs.nvidia.com/cuda/pdf/CUDA_C_Programming_Guide.pdf. [cited by applicant]
criu.org, “Checkpoint/Restore in Userspace,” pp. 1-2, Nov. 3, 2020, as downloaded from https://criu.org/Main_Page. [cited by applicant]
“Berkley Lab Checkpoint/Restart (BLCR) for Linux,” pp. 1-4, Sep. 24, 2021, as downloaded from https://crd.lbl.gov/divisions/amcr/computer-science-amcr/class/research/past-projects/BLCR/. [cited by applicant]
Sourceforge, “DMTCP: Distributed MultiThreaded CheckPointing,” pp. 1-5, May 4, 2022, as downloaded from. [cited by applicant]
Kerrisk, “mmap(2)—Linux manual page,” pp. 1-13, update Aug. 12, 2021, as downloaded from https://web.archive.org/web/20210812204236/https://man7.org/linux/man-pages/man2/mmap.2.html. [cited by applicant]
Kerrisk, “proc(5)—Linux manual page,” pp. 1-60, update Aug. 19, 2021, as downloaded from https://web.archive.org/web/20210819132712/https://man7.org/linux/man-pages/man5/proc.5.html. [cited by applicant]
Kerrisk, “dlopen(3)—Linux manual page,” pp. 1-9, update Aug. 15, 2021, as downloaded from https://web.archive.org/web/20210815104050/https://man7.org/linux/man-pages/man3/dlopen.3.html. [cited by applicant]
Kerrisk, “signal(2)—Linux manual page,” pp. 1-3, update Aug. 1, 2021, https://web.archive.org/web/20210801194930/ttps://man7.org/linux/man-pages/man2/signal.2.html. [cited by applicant]
Garg et al., “CRUM: Checkpoint-Restart Support for CUDA's Unified Memory”, pp. 1-22, Aug. 1, 2018, as downloaded from https://arxiv.org/pdf/1808.00117.pdf. [cited by applicant]
Jain et al., “CRAC: Checkpoint-Restart Architecture for CUDA with Streams and UVM,” SC '20: Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, article No. 77, p… [cited by applicant]
International Application # PCT/IB2022/058568 Search Report dated Dec. 28, 2022. [cited by applicant]