IP Library Granted Patent US 12,505,037
Granted Patent B2
US 12,505,037 · App. 18/363,285 · Granted Dec 23, 2025

Garbage collection method and apparatus

Inventors: Dong-Wook Kang (Daejeon, KR); Gae-Il An (Daejeon, KR); Hong-Il Ju (Daejeon, KR)
Assignee: ELECTRONICS AND TELECOMMUNICATIONS RESEARCH INSTITUTE
G06F12/0253G06F2212/7205
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,505,037
App. No.
18/363,285
Granted
Dec 23, 2025
Kind
B2
Abstract

Disclosed herein are a garbage collection method and apparatus. The garbage collection method includes when an area dynamically allocated through a malloc( ) function or a new operator of a standard C library is deallocated through a free( ) function or a delete operator, inserting the deallocated area into a quarantine list, recording a base address and an end address of each of areas inserted into the quarantine list in a CSR_quarantined_chunks register, finding a physical address of a memory page used by a processor and searching data in the memory page for a value included in a quarantined area of the CSR_quarantined_chunks register, when a value included in the quarantined area is not present, setting a state flag bit of the register to 0, and deleting an area which the state flag bit is 0 from the quarantine list, and inserting the area into a free list.

Claims (22)

1 . A garbage collection method, comprising:

deallocating an area dynamically allocated through a malloc function or a new operator of a standard C library through a free function or a delete operator, thereby inserting the deallocated area into a quarantine list;

recording a base address and an end address of each of areas inserted into the quarantine list in a CSR (control and status register)_quarantined_chunks register;

finding a physical address of a memory page used by a processor and searching pieces of data in the memory page for a value included in a quarantined area of the CSR_quarantined_chunks register;

determining a value included in the quarantined area of the CSR_quarantined_chunks register is not present, thereby setting a state flag bit of the CSR_quarantined_chunks register to 0; and

deleting an area which the state flag bit of the CSR_quarantined_chunks register is 0 from the quarantine list, and inserting the area into a free list in which reallocation is enabled,

wherein, to improve search efficiency of dangling pointers, the tag value is configured such that a 1-bit tag value is added for each specific size of a memory or such that a shadow memory is allocated and used as a tag value.

2 . The garbage collection method of claim 1 , wherein the CSR_quarantined_chunks register includes a virtual base address, a virtual end address, and a state flag bit of each quarantined memory area.

3 . The garbage collection method of claim 1 , wherein the state flag bit has a value of 1 in a quarantined state, and is changed to 0 when no dangling pointer is determined to be present.

4 . The garbage collection method of claim 1 , wherein the tag value is initialized to 0 and is set to 1 when a value between values of CSR_HEAP_BASE and CSR_HEAP_END is written to the memory in execution.

5 . The garbage collection method of claim 1 , wherein a tag value of a heap area is initialized to 0 when a specific area is deallocated through a free function.

6 . The garbage collection method of claim 1 , wherein a tag value of a stack area is initialized for a stack area that is no longer used while changing a stack pointer value when a function is returned.

7 . A garbage collection apparatus, comprising:

a memory configured to store a control program for performing garbage collection; and

a processor configured to execute the control program stored in the memory,

wherein the processor is configured to deallocate an area dynamically allocated through a malloc function or a new operator of a standard C library through a free function or a delete operator, insert the deallocated area into a quarantine list, record a base address and an end address of each of areas inserted into the quarantine list in a CSR (control and status register)_quarantined_chunks register, find a physical address of a memory page used by the processor, search pieces of data in the memory page for a value included in a quarantined area of the CSR_quarantined_chunks register, determine a value included in the quarantined area of the CSR_quarantined_chunks register is not present, set a state flag bit of the CSR_quarantined_chunks register to 0, delete an area which the state flag bit of the CSR_quarantined_chunks register is 0 from the quarantine list, and insert the area into a free list in which reallocation is enabled,

wherein, to improve search efficiency of dangling pointers, the processor is configured to perform control such that a 1-bit tag value is added for each specific size of a memory or such that a shadow memory is allocated and used as a tag value.

8 . The garbage collection apparatus of claim 7 , wherein the CSR_quarantined_chunks register includes a virtual base address, a virtual end address, and a state flag bit of each quarantined memory area.

9 . The garbage collection apparatus of claim 7 , wherein the processor is configured to control the state flag bit such that the state flag bit has a value of 1 in a quarantined state and is changed to 0 when no dangling pointer is determined to be present.

10 . The garbage collection apparatus of claim 7 , wherein the processor is configured to perform control such that the tag value is initialized to 0 and is set to 1 when a value between values of CSR_HEAP_BASE and CSR_HEAP_END is written to the memory in execution.

11 . The garbage collection apparatus of claim 7 , wherein the processor is configured to perform control such that a tag value of a heap area is initialized to 0 when a specific area is deallocated through a free function.

12 . The garbage collection apparatus of claim 7 , wherein the processor is configured to perform control such that a tag value of a stack area is initialized for a stack area that is no longer used while changing a stack pointer value when a function is returned.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 2, 2023
From: KANG, DONG-WOOK; AN, GAE-IL; JU, HONG-IL
To: ELECTRONICS AND TELECOMMUNICATIONS RESEARCH INSTITUTE
Reel/Frame 064470/0288 →
Priority Claims (1)
KR 10-2022-0138096 · Oct 25, 2022 · national
Continuity (2)
Related Publication 20240134790A1 · Apr 25, 2024
Related Publication 20240232073A9 · Jul 11, 2024
References Cited (13)
US 8327109B2 · Caspole · 2012 [cited by applicant]
US 9396103B2 · Sinclair et al. · 2016 [cited by applicant]
US 10776491B2 · Kim et al. · 2020 [cited by applicant]
US 10884873B2 · Hwang et al. · 2021 [cited by applicant]
US 11630767B2 · Pandurangan et al. · 2023 [cited by applicant]
US 20030056149A1 · Hue · 2003 [cited by examiner]
US 20150227414A1 · Varma · 2015 [cited by applicant]
US 20180074885A1 · Giloni · 2018 [cited by examiner]
US 20210004456A1 · Savry · 2021 [cited by examiner]
US 20230063568A1 · Hassan · 2023 [cited by examiner]
KR 1020100034743A · 2010 [cited by applicant]
KR 101626533B1 · 2016 [cited by applicant]
KR 1020180119473A · 2018 [cited by applicant]