KR102477775B1 - Garbage collection device having subunit and memory system having the same - Google Patents

Garbage collection device having subunit and memory system having the same Download PDF

Info

Publication number
KR102477775B1
KR102477775B1 KR1020200125740A KR20200125740A KR102477775B1 KR 102477775 B1 KR102477775 B1 KR 102477775B1 KR 1020200125740 A KR1020200125740 A KR 1020200125740A KR 20200125740 A KR20200125740 A KR 20200125740A KR 102477775 B1 KR102477775 B1 KR 102477775B1
Authority
KR
South Korea
Prior art keywords
memory
host
memory device
unit
bitmap
Prior art date
Application number
KR1020200125740A
Other languages
Korean (ko)
Other versions
KR20220043947A (en
Inventor
이재욱
장재영
허준
이예진
Original Assignee
서울대학교산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 서울대학교산학협력단 filed Critical 서울대학교산학협력단
Priority to KR1020200125740A priority Critical patent/KR102477775B1/en
Publication of KR20220043947A publication Critical patent/KR20220043947A/en
Application granted granted Critical
Publication of KR102477775B1 publication Critical patent/KR102477775B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • G06F12/0261Garbage collection, i.e. reclamation of unreferenced memory using reference counting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1668Details of memory controller
    • G06F13/1694Configuration of memory controller to different memory types
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1004Compatibility, e.g. with legacy hardware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7205Cleaning, compaction, garbage collection, erase control

Abstract

본 발명의 실시 예에 따른 가비지 컬렉션 장치는, 메모리 장치로부터 수신된 제1 응답 신호를 기반으로, 제1 객체를 카피하거나, 또는 제1 객체가 제2 객체에 의해 참조되는지 여부를 가리키는 서치 값을 호스트로 출력하도록 구성된 카피 서치 유닛, 제1 객체가 제2 객체에 의해 참조된다고 판별되면, 메모리 장치로부터 수신된 제2 응답 신호를 기반으로, 제1 객체의 크기 정보를 포함하는 비트 카운트 값을 호스트로 출력하도록 구성된 비트맵 카운트 유닛, 및 메모리 장치로부터 수신된 제3 응답 신호를 기반으로, 제1 객체의 메타데이터를 갱신하거나, 또는 제1 객체를 스택 메모리에 푸시하도록 구성된 스캔 푸시 유닛을 포함한다.A garbage collection device according to an embodiment of the present invention copies a first object based on a first response signal received from a memory device or generates a search value indicating whether the first object is referenced by a second object. If the copy search unit configured to output to the host determines that the first object is referenced by the second object, the host converts a bit count value including size information of the first object based on the second response signal received from the memory device to the host and a scan push unit configured to update metadata of the first object or push the first object to the stack memory based on the third response signal received from the memory device. .

Description

서브 유닛을 갖는 가비지 컬렉션 장치 및 이를 포함하는 메모리 시스템{GARBAGE COLLECTION DEVICE HAVING SUBUNIT AND MEMORY SYSTEM HAVING THE SAME}Garbage collection device having a subunit and a memory system including the same

본 발명은 가비지 컬렉션 장치 및 이를 포함하는 메모리 시스템에 관한 것으로, 좀 더 상세하게는 서브 유닛을 갖는 가비지 컬렉션 장치 및 이를 포함하는 메모리 시스템에 관한 것이다. The present invention relates to a garbage collection device and a memory system including the same, and more particularly, to a garbage collection device having sub units and a memory system including the same.

메모리 장치의 저장 용량은 유한하므로, 메모리 장치에 할당된 객체는 사용이 완료되면 다른 객체의 할당을 위해 회수되어야 한다. 메모리를 관리하는 기법들 중 하나로 가비지 컬렉션(GC; Garbage Collection)이 있다. 가비지 컬렉션은 동적으로 할당된 메모리 공간 중 더 이상 사용되지 않는 공간을 자동으로 탐지하여 해제하는 기법이다. 가비지 컬렉션에 의해 메모리 누수, 허상 포인터(dangling pointer) 등과 같은 오류가 억제될 수 있다.Since the storage capacity of the memory device is finite, objects allocated to the memory device must be reclaimed for allocation of other objects when use is completed. One of the techniques for managing memory is garbage collection (GC). Garbage collection is a technique that automatically detects and releases unused space among dynamically allocated memory spaces. Errors such as memory leaks and dangling pointers can be suppressed by garbage collection.

일반적으로, 가비지 컬렉션은 CPU(Central Processing Unit) 상에서 소프트웨어적으로 수행될 수 있다. 그러나, 최근에 메모리 장치에서 입출력되는 데이터의 크기가 급격하게 증가함에 따라, CPU 상에서 가비지 컬렉션에 의한 오버헤드가 증가하고 있다. 이러한 오버헤드에 의해서, 애플리케이션(application)의 처리량(throughput)이 저하되고, 지연 시간(latency)이 증가하는 문제가 있다. In general, garbage collection can be performed in software on a central processing unit (CPU). However, as the size of data input/output from a memory device has rapidly increased recently, overhead due to garbage collection on a CPU is increasing. Due to this overhead, there is a problem in that the throughput of the application is lowered and the latency is increased.

본 발명은 상술된 기술적 과제를 해결하기 위한 것으로써, 본 발명의 목적은 가비지 컬렉션에 의한 오버헤드를 감소시키기 위한 서브 유닛을 갖는 가비지 컬렉션 장치 및 이를 포함하는 메모리 시스템을 제공하는데 있다. An object of the present invention is to provide a garbage collection device having a sub-unit for reducing overhead caused by garbage collection and a memory system including the same.

본 발명의 실시 예에 따른 가비지 컬렉션 장치는, 메모리 장치로부터 수신된 제1 응답 신호를 기반으로, 제1 객체를 카피하거나, 또는 상기 제1 객체가 제2 객체에 의해 참조되는지 여부를 가리키는 서치 값을 호스트로 출력하도록 구성된 카피 서치 유닛, 상기 제1 객체가 상기 제2 객체에 의해 참조된다고 판별되면, 상기 메모리 장치로부터 수신된 제2 응답 신호를 기반으로, 상기 제1 객체의 크기 정보를 포함하는 비트 카운트 값을 상기 호스트로 출력하도록 구성된 비트맵 카운트 유닛, 및 상기 메모리 장치로부터 수신된 제3 응답 신호를 기반으로, 상기 제1 객체의 메타데이터를 갱신하거나, 또는 상기 제1 객체를 스택 메모리에 푸시하도록 구성된 스캔 푸시 유닛을 포함한다.A garbage collection device according to an embodiment of the present invention copies a first object based on a first response signal received from a memory device, or a search value indicating whether the first object is referenced by a second object A copy search unit configured to output to a host, when it is determined that the first object is referenced by the second object, including size information of the first object based on a second response signal received from the memory device. Based on a bitmap count unit configured to output a bit count value to the host and a third response signal received from the memory device, update metadata of the first object or store the first object in a stack memory and a scan push unit configured to push.

예시적인 실시 예에서, 상기 메모리 장치는 제1 요청 신호에 응답하여 상기 제1 응답 신호를 생성하도록 구성되고, 상기 카피 서치 유닛은 상기 호스트로부터 제1 커맨드를 수신하고, 상기 제1 커맨드를 기반으로 상기 제1 요청 신호를 상기 메모리 장치로 출력하도록 구성된 제1 요청 생성기, 상기 제1 응답 신호를 기반으로, 카피 정보 신호 또는 서치 정보 신호를 생성하도록 구성된 카피 서치 모듈, 상기 카피 정보 신호를 기반으로, 상기 카피된 제1 객체에 대응하는 어드레스를 상기 메모리 장치로 출력하도록 구성된 어드레스 계산기, 및 상기 제1 객체가 상기 제2 객체에 의해 참조되는지를 판별하고, 상기 서치 값을 포함하는 제1 리턴 신호를 상기 호스트로 출력하도록 구성된 객체 판별기를 포함한다.In an exemplary embodiment, the memory device is configured to generate the first response signal in response to a first request signal, the copy search unit receives a first command from the host, and based on the first command A first request generator configured to output the first request signal to the memory device, a copy search module configured to generate a copy information signal or a search information signal based on the first response signal, based on the copy information signal, an address calculator configured to output an address corresponding to the copied first object to the memory device, determine whether the first object is referenced by the second object, and provide a first return signal including the search value and an object discriminator configured to output to the host.

예시적인 실시 예에서, 상기 메모리 장치는 제2 요청 신호에 응답하여 상기 제2 응답 신호를 생성하도록 구성되고, 상기 제1 객체가 상기 제2 객체에 의해 참조된다고 판별되면, 상기 비트맵 카운트 유닛은 상기 호스트로부터 제2 커맨드를 수신하고, 상기 제2 커맨드를 기반으로 상기 제2 요청 신호를 상기 메모리 장치로 출력하도록 구성된 제2 요청 생성기, 상기 제2 응답 신호를 기반으로 상기 메모리 장치에서 상기 제1 객체가 시작되는 위치를 포함하는 비긴 맵(begin map)에 대응하는 제1 카운트 값을 생성하도록 구성된 비긴 맵 모듈, 상기 제2 응답 신호를 기반으로 상기 메모리 장치에서 상기 제1 객체가 끝나는 위치를 포함하는 엔드 맵(end map)에 대응하는 제2 카운트 값을 생성하도록 구성된 엔드 맵 모듈, 상기 제1 카운트 값에서 상기 제2 카운트 값을 감산한 제3 카운트 값을 생성하도록 구성된 감산기, 및 상기 제1 카운트 값에서 상기 제3 카운트 값을 가산하여 상기 제1 객체의 비트맵을 복원하고, 상기 비트맵에서 특정 값을 갖는 비트의 개수를 카운트하여 상기 비트 카운트 값을 생성하고, 상기 비트 카운트 값을 포함하는 제2 리턴 신호를 상기 호스트로 출력하도록 구성된 카운터 회로를 포함한다.In an exemplary embodiment, the memory device is configured to generate the second response signal in response to a second request signal, and if it is determined that the first object is referenced by the second object, the bitmap count unit a second request generator configured to receive a second command from the host and output the second request signal to the memory device based on the second command; A begin map module configured to generate a first count value corresponding to a begin map including a location where an object starts, and a location where the first object ends in the memory device based on the second response signal an end map module configured to generate a second count value corresponding to an end map corresponding to an end map, a subtractor configured to generate a third count value obtained by subtracting the second count value from the first count value, and the first count value Restoring the bitmap of the first object by adding the third count value to the count value, generating the bit count value by counting the number of bits having a specific value in the bitmap, and including the bit count value and a counter circuit configured to output a second return signal to the host.

예시적인 실시 예에서, 상기 메모리 장치는 제3 요청 신호에 응답하여 상기 제3 응답 신호를 생성하도록 구성되고, 상기 스캔 푸시 유닛은 상기 호스트로부터 제3 커맨드를 수신하고, 상기 제3 커맨드를 기반으로 상기 제3 요청 신호를 상기 메모리 장치로 출력하도록 구성된 제3 요청 생성기, 상기 제3 응답 신호를 기반으로, 상기 제1 객체가 마크된 제1 케이스, 상기 제1 객체가 마크되지 않고 상기 제1 객체가 영 제너레이션(young generation)에 포함된 제2 케이스, 및 상기 제1 객체가 마크되지 않고 상기 제1 객체가 올드 제너레이션(old generation)에 포함된 제3 케이스 중 하나를 판별하도록 구성된 타입 판별기, 상기 제1 케이스로 판별되면, 상기 제1 객체의 상기 메타데이터를 갱신하도록 구성된 메타데이터 업데이터, 상기 제2 케이스 또는 상기 제3 케이스로 판별되면, 상기 제1 객체를 상기 스택 메모리에 푸시하도록 구성된 푸시 스택 모듈, 및 상기 제3 케이스로 판별되면 상기 제1 객체를 마크하도록 구성된 객체 마커를 포함한다.In an exemplary embodiment, the memory device is configured to generate the third response signal in response to a third request signal, the scan push unit receives a third command from the host, and based on the third command A third request generator configured to output the third request signal to the memory device, a first case in which the first object is marked based on the third response signal, the first object not marked and the first object A type discriminator configured to determine one of a second case in which is included in the young generation and a third case in which the first object is not marked and the first object is included in the old generation; If it is determined as the first case, a metadata updater configured to update the metadata of the first object, and if it is determined as the second case or the third case, a push configured to push the first object to the stack memory. a stack module, and an object marker configured to mark the first object when it is determined as the third case.

예시적인 실시 예에서, 상기 호스트, 상기 카피 서치 유닛, 상기 비트맵 카운트 유닛, 및 상기 스캔 푸시 유닛과 연결된 호스트 인터페이스 회로, 및 상기 메모리 장치, 상기 카피 서치 유닛, 상기 비트맵 카운트 유닛, 및 상기 스캔 푸시 유닛과 연결된 메모리 인터페이스 회로를 더 포함한다.In an exemplary embodiment, a host interface circuit connected to the host, the copy search unit, the bitmap count unit, and the scan push unit, and the memory device, the copy search unit, the bitmap count unit, and the scan push unit. A memory interface circuit coupled with the push unit is further included.

예시적인 실시 예에서, 상기 호스트 인터페이스 회로는 상기 호스트로부터 제1 내지 제3 커맨드 중 적어도 하나를 수신하도록 구성된 메인 커맨드 큐, 상기 메인 커맨드 큐로부터 상기 제1 커맨드를 수신하고, 상기 카피 서치 유닛으로 상기 제1 커맨드를 출력하도록 구성된 제1 커맨드 큐, 상기 메인 커맨드 큐로부터 상기 제2 커맨드를 수신하고, 상기 비트맵 카운트 유닛으로 상기 제2 커맨드를 출력하도록 구성된 제2 커맨드 큐, 상기 메인 커맨드 큐로부터 상기 제3 커맨드를 수신하고, 상기 스캔 푸시 유닛으로 상기 제3 커맨드를 출력하도록 구성된 제3 커맨드 큐, 및 상기 카피 서치 유닛, 상기 비트맵 카운트 유닛, 및 상기 스캔 푸시 유닛 중 적어도 하나로부터 리턴 값을 수신하고, 상기 호스트로 상기 리턴 값을 출력하도록 구성된 리턴 큐를 포함한다.In an exemplary embodiment, the host interface circuitry is configured to receive at least one of first to third commands from the host, receive the first command from the main command queue, and send the copy search unit to the a first command queue configured to output a first command, a second command queue configured to receive the second command from the main command queue and output the second command to the bitmap count unit, Receive a third command queue configured to receive a third command and output the third command to the scan push unit, and receive a return value from at least one of the copy search unit, the bitmap count unit, and the scan push unit and a return queue configured to output the return value to the host.

예시적인 실시 예에서, 상기 메모리 인터페이스 회로는 상기 카피 서치 유닛, 상기 비트맵 카운트 유닛, 및 상기 스캔 푸시 유닛 중 적어도 하나와 연결되고, 상기 제1 객체의 상기 메타데이터를 저장하도록 구성된 메타데이터 캐시, 상기 비트맵 카운트 유닛 및 상기 스캔 푸시 유닛 중 적어도 하나와 연결되고, 상기 제1 객체가 포함된 메모리 공간에 대응하는 비트맵을 저장하도록 구성된 비트맵 캐시, 및 상기 메타데이터 캐시, 상기 비트맵 캐시, 및 상기 메모리 장치와 연결된 변환 색인 버퍼(translation lookaside buffer)를 포함한다.In an exemplary embodiment, the memory interface circuit may include a metadata cache connected to at least one of the copy search unit, the bitmap count unit, and the scan push unit and configured to store the metadata of the first object; a bitmap cache connected to at least one of the bitmap count unit and the scan push unit and configured to store a bitmap corresponding to a memory space including the first object; and the metadata cache, the bitmap cache, and a translation lookaside buffer connected to the memory device.

본 발명의 실시 예에 따른 메모리 시스템은 제1 내지 제3 커맨드들을 생성하도록 구성된 호스트, 상기 제1 내지 제3 커맨드들에 대응하는 제1 내지 제3 응답 신호들을 생성하도록 구성되고, 제1 및 제2 객체들을 포함하는 메모리 공간을 갖는 메모리 장치, 및 가비지 컬렉션 장치를 포함하는 메모리 컨트롤러를 포함하되, 상기 가비지 컬렉션 장치는 상기 제1 응답 신호를 기반으로, 상기 제1 객체를 카피하거나, 또는 상기 제1 객체가 상기 제2 객체에 의해 참조되는지 여부를 가리키는 서치 값을 상기 호스트로 출력하도록 구성된 카피 서치 유닛, 상기 제1 객체가 상기 제2 객체에 의해 참조된다고 판별되면, 상기 제2 응답 신호를 기반으로, 상기 제1 객체의 크기 정보를 포함하는 비트 카운트 값을 상기 호스트로 출력하도록 구성된 비트맵 카운트 유닛, 및 상기 제3 응답 신호를 기반으로, 상기 제1 객체의 메타데이터를 갱신하거나, 또는 상기 제1 객체를 스택 메모리에 푸시하도록 구성된 스캔 푸시 유닛을 포함한다.A memory system according to an embodiment of the present invention includes a host configured to generate first to third commands, first to third response signals corresponding to the first to third commands, and first to third commands. A memory device having a memory space including two objects, and a memory controller including a garbage collection device, wherein the garbage collection device copies the first object based on the first response signal or a copy search unit configured to output to the host a search value indicating whether one object is referenced by the second object, if it is determined that the first object is referenced by the second object, based on the second response signal a bitmap count unit configured to output a bit count value including size information of the first object to the host, and updating metadata of the first object based on the third response signal; and a scan push unit configured to push the first object to the stack memory.

예시적인 실시 예에서, 상기 가비지 컬렉션 장치는 로직 레이어 상에 형성되고, 상기 메모리 장치는 제1 HMC(Hybrid memory cube)를 포함하고, 상기 제1 HMC는 상기 로직 레이어 상에 제1 방향으로 적층된 적어도 하나의 제1 DRAM(Dynamic Random Access Memory) 레이어를 포함한다.In an exemplary embodiment, the garbage collection device is formed on a logic layer, the memory device includes a first hybrid memory cube (HMC), and the first HMC is stacked on the logic layer in a first direction. It includes at least one first dynamic random access memory (DRAM) layer.

예시적인 실시 예에서, 상기 메모리 장치는 제2 내지 제4 HMC를 더 포함하고, 상기 호스트는 상기 로직 레이어로부터 상기 제1 방향에 수직한 제2 방향으로 이격되어 위치하고, 상기 제2 HMC는 상기 로직 레이어로부터 상기 제1 및 제2 방향으로 정의된 평면에 수직한 제3 방향으로 이격되어 위치하고, 상기 제3 HMC는 상기 로직 레이어로부터 상기 제2 방향의 반대 방향으로 이격되어 위치하고, 상기 제4 HMC는 상기 로직 레이어로부터 상기 제3 방향의 반대 방향으로 이격되어 위치한다.In an exemplary embodiment, the memory device further includes second to fourth HMCs, the host is spaced apart from the logic layer in a second direction perpendicular to the first direction, and the second HMC comprises the logic layer. The third HMC is spaced apart from the logic layer in a third direction perpendicular to a plane defined by the first and second directions, the third HMC is spaced apart from the logic layer in a direction opposite to the second direction, and the fourth HMC is It is spaced apart from the logic layer in a direction opposite to the third direction.

본 발명의 실시 예에 따르면, 가비지 컬렉션에 의한 오버헤드를 감소시키기 위한 서브 유닛을 갖는 가비지 컬렉션 장치 및 이를 포함하는 메모리 시스템이 제공된다.According to an embodiment of the present invention, a garbage collection device having a subunit for reducing overhead due to garbage collection and a memory system including the same are provided.

또한, 본 발명의 실시 예에 따르면, 객체 지향 언어(예를 들어, Java)에서 호환 가능하고, 객체들의 크기를 카운트하기 위해 최적화된 알고리즘을 갖고, 3차원 메모리에서 구현되는 가비지 컬렉션 장치 및 이를 포함하는 메모리 시스템이 제공된다.In addition, according to an embodiment of the present invention, a garbage collection device compatible with an object-oriented language (eg, Java), having an algorithm optimized for counting the size of objects, and implemented in a three-dimensional memory, including the same A memory system is provided.

도 1은 본 발명의 실시 예에 따른 메모리 시스템을 예시적으로 보여주는 블록도이다.
도 2a는 본 발명의 실시 예에 따른 가비지 컬렉션을 설명하는 도면이다.
도 2b는 도 2a의 메모리 공간들을 예시적으로 설명하는 도면이다.
도 3은 본 발명의 실시 예에 따른 가비지 컬렉션 장치를 예시적으로 보여주는 블록도이다.
도 4는 도 3의 호스트 인터페이스 회로를 예시적으로 구체화한 도면이다.
도 5는 도 3의 카피 서치 유닛을 예시적으로 구체화한 블록도이다.
도 6a는 도 3의 비트맵 카운트 유닛을 예시적으로 구체화한 블록도이다.
도 6b는 도 6a의 비트 카운트 값을 계산하는 방법을 예시적으로 설명하는 도면이다.
도 7은 도 3의 스캔 푸시 유닛을 예시적으로 구체화한 블록도이다.
도 8은 도 3의 메모리 인터페이스 회로를 예시적으로 구체화한 블록도이다.
도 9는 본 발명의 실시 예에 따른 3차원 구조를 갖는 메모리 시스템을 예시적으로 보여주는 도면이다.
도 10은 본 발명의 실시 예에 따른 마이너 가비지 컬렉션을 수행하는 방법을 예시적으로 구체화한 순서도이다.
도 11은 본 발명의 실시 예에 따른 메이저 가비지 컬렉션을 수행하는 방법을 예시적으로 구체화한 순서도이다.
1 is a block diagram showing a memory system according to an exemplary embodiment of the inventive concept.
2A is a diagram illustrating garbage collection according to an embodiment of the present invention.
FIG. 2B is a diagram illustrating the memory spaces of FIG. 2A by way of example.
3 is a block diagram showing a garbage collection apparatus according to an embodiment of the present invention by way of example.
FIG. 4 is an illustrative embodiment of the host interface circuit of FIG. 3 .
FIG. 5 is a block diagram exemplarily embodying the copy search unit of FIG. 3 .
FIG. 6A is a block diagram illustratively embodying the bitmap count unit of FIG. 3 .
FIG. 6B is a diagram illustrating a method of calculating the bit count value of FIG. 6A by way of example.
FIG. 7 is a block diagram exemplarily embodying the scan push unit of FIG. 3 .
FIG. 8 is a block diagram exemplarily embodying the memory interface circuit of FIG. 3 .
9 is a diagram showing a memory system having a 3D structure according to an exemplary embodiment of the present invention.
10 is a flowchart illustrating a method of performing minor garbage collection according to an exemplary embodiment of the present invention.
11 is a flowchart illustrating a method of performing major garbage collection according to an exemplary embodiment of the present invention.

이하에서, 본 발명의 기술 분야에서 통상의 지식을 가진 자가 본 발명을 용이하게 실시할 수 있을 정도로, 본 발명의 실시 예들이 명확하고 상세하게 기재될 것이다. 이하에서, 설명의 편의를 위하여, 유사한 구성 요소들은 동일하거나 또는 유사한 참조 번호를 사용하여 표현된다.Hereinafter, embodiments of the present invention will be described clearly and in detail to the extent that those skilled in the art can easily practice the present invention. Hereinafter, for convenience of description, similar components are represented using the same or similar reference numerals.

이하의 도면들 또는 상세한 설명에서의 모듈들은 도면에 도시되거나 또는 상세한 설명에 기재된 구성 요소 이외에 다른 것들과 연결될 수 있다. 모듈들 또는 구성 요소들 사이의 연결은 각각 직접적 또는 비직접적일 수 있다. 모듈들 또는 구성 요소들 사이의 연결은 각각 통신에 의한 연결이거나 또는 물리적인 접속일 수 있다.Modules in the following drawings or detailed description may be connected with other components other than those shown in the drawings or described in the detailed description. Connections between modules or components may be direct or non-direct, respectively. The connection between the modules or components may be a communication connection or a physical connection, respectively.

도 1은 본 발명의 실시 예에 따른 메모리 시스템(10)을 예시적으로 보여주는 블록도이다. 도 1을 참조하면, 메모리 시스템(10)은 호스트(11), 메모리 컨트롤러(12), 및 메모리 장치(13)를 포함할 수 있다. 1 is a block diagram showing a memory system 10 according to an exemplary embodiment of the inventive concept. Referring to FIG. 1 , a memory system 10 may include a host 11 , a memory controller 12 , and a memory device 13 .

호스트(11)는 메모리 컨트롤러(12)와 연결될 수 있다. 호스트(11)는 메모리 컨트롤러(12)의 동작을 제어하기 위한 커맨드를 출력할 수 있다. 호스트(11)는 메모리 컨트롤러(12)로부터 데이터, 커맨드에 대응하는 리턴 값 등을 수신할 수 있다. 예를 들어, 호스트(11)는 중앙 처리 장치(CPU; Central Processing Unit), 그래픽 처리 장치(GPU; Graphics Processing Unit), 디지털 신호 프로세서(DSP; Digital Signal Processor), 등과 같은 프로세서일 수 있다. The host 11 may be connected to the memory controller 12 . The host 11 may output a command for controlling the operation of the memory controller 12 . The host 11 may receive data, a return value corresponding to a command, and the like from the memory controller 12 . For example, the host 11 may be a processor such as a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), or the like.

메모리 컨트롤러(12)는 호스트(11) 및 메모리 장치(13)와 연결될 수 있다. 메모리 컨트롤러(12)는 호스트(11)로부터 수신된 커맨드를 기반으로 메모리 장치(13)에 저장된 데이터를 처리할 수 있다. 예를 들어, 메모리 컨트롤러(12)는 호스트(11)로부터의 커맨드를 기반으로, 메모리 장치(13)에 저장된 데이터를 읽거나, 메모리 장치(13)에 데이터에 데이터를 쓸 수 있다. The memory controller 12 may be connected to the host 11 and the memory device 13 . The memory controller 12 may process data stored in the memory device 13 based on a command received from the host 11 . For example, the memory controller 12 may read data stored in the memory device 13 or write data to the memory device 13 based on a command from the host 11 .

예시적인 실시 예에서, 메모리 컨트롤러(12)는 가비지 컬렉션 장치(100)를 포함할 수 있다. 가비지 컬렉션 장치(100)는 가비지 컬렉션(GC; Garbage Collection)을 수행하거나, 호스트(11)에서 수행되는 가비지 컬렉션을 보조하는 장치일 수 있다. 가비지 컬렉션은 동적으로 할당된 메모리 공간 중 더 이상 사용되지 않는 공간을 자동으로 탐지하여 해제하는 동작일 수 있다. 가비지 컬렉션에 의해 메모리 누수, 허상 포인터(dangling pointer) 등과 같은 오류가 억제될 수 있다. 가비지 컬렉션은 도 2a를 참조하여 보다 상세하게 후술될 것이다. 가비지 컬렉션 장치(100)에 대한 보다 상세한 설명은 도 3과 함께 후술될 것이다.In an example embodiment, the memory controller 12 may include the garbage collection device 100 . The garbage collection device 100 may be a device that performs garbage collection (GC) or assists garbage collection performed by the host 11 . Garbage collection may be an operation of automatically detecting and freeing a space that is no longer used among dynamically allocated memory spaces. Errors such as memory leaks and dangling pointers can be suppressed by garbage collection. Garbage collection will be described later in more detail with reference to FIG. 2A. A more detailed description of the garbage collection apparatus 100 will be described later along with FIG. 3 .

메모리 장치(13)는 메모리 컨트롤러(12)와 연결될 수 있다. 메모리 장치(13)는 메모리 컨트롤러(12)로부터 수신된 데이터를 저장하거나, 저장된 데이터를 메모리 컨트롤러(12)로 출력할 수 있다. 즉, 메모리 장치(13)는 데이터를 저장하는 장치일 수 있다.The memory device 13 may be connected to the memory controller 12 . The memory device 13 may store data received from the memory controller 12 or output the stored data to the memory controller 12 . That is, the memory device 13 may be a device that stores data.

예시적인 실시 예에서, 메모리 장치(13)는 휘발성 메모리(Volatile Memory)일 수 있다. 예를 들어, 메모리 장치(13)는 DRAM(Dynamic Random Access Memory)일 수 있다. 메모리 장치(13)에서 데이터를 위한 메모리 공간의 할당 및 해제가 빈번하게 일어날 수 있다. 메모리 장치(13)에서 가비지 컬렉션과 같은 메모리 관리가 필요할 수 있다.In an exemplary embodiment, the memory device 13 may be a volatile memory. For example, the memory device 13 may be Dynamic Random Access Memory (DRAM). Allocation and release of memory space for data in the memory device 13 may occur frequently. Memory management such as garbage collection may be required in the memory device 13 .

예시적인 실시 예에서, 메모리 장치(13)는 3차원 적층 기법을 기반으로 구현될 수 있다. 예를 들어, 메모리 장치(13)는 데이터를 저장하기 위한 복수의 DRAM 레이어(layer)들을 포함할 수 있다. 3차원 적층 기법을 기반으로 구현된 메모리 장치(13)에 대한 보다 상세한 설명은 도 9와 함께 후술될 것이다.In an exemplary embodiment, the memory device 13 may be implemented based on a 3D stacking technique. For example, the memory device 13 may include a plurality of DRAM layers for storing data. A more detailed description of the memory device 13 implemented based on the 3D stacking technique will be described later along with FIG. 9 .

도 2a는 본 발명의 실시 예에 따른 가비지 컬렉션을 설명하는 도면이다. 도 1 및 도 2a를 참조하면, 메모리 시스템(10)에서 수행되는 가비지 컬렉션이 예시적으로 설명된다. 가비지 컬렉션은 동적으로 할당된 메모리 공간 중 더 이상 사용되지 않는 공간을 자동으로 탐지하여 해제하는 동작일 수 있다. 메모리 공간은 객체(object)로 지칭될 수 있다. 메모리 공간이 사용되는지 여부는 객체가 다른 객체에 의해 참조되는지 여부를 기준으로 판별될 수 있다. 객체는 도 1의 메모리 장치(13)에 저장될 데이터를 포함할 수 있다.2A is a diagram illustrating garbage collection according to an embodiment of the present invention. Referring to FIGS. 1 and 2A , garbage collection performed in the memory system 10 is described as an example. Garbage collection may be an operation of automatically detecting and freeing a space that is no longer used among dynamically allocated memory spaces. A memory space may be referred to as an object. Whether memory space is used can be determined based on whether an object is referenced by another object. The object may include data to be stored in the memory device 13 of FIG. 1 .

본 발명의 실시 예에 따르면, 메모리 시스템(10)은 객체 지향 언어를 기반으로 메모리 공간을 관리할 수 있다. 예를 들어, 사용자가 직접 객체를 할당하고 해제하는 C언어 및 C++언어 등과 같은 프로그래밍 언어와 달리, 객체가 자동적으로 관리되는 자바(Java), 파이썬(Phython), C# 언어, 스칼라(scala) 등과 같은 객체 지향 언어가 사용될 수 있다.According to an embodiment of the present invention, the memory system 10 may manage a memory space based on an object-oriented language. For example, unlike programming languages such as C and C++ languages in which users directly allocate and deallocate objects, objects are automatically managed in languages such as Java, Python, C#, and scala. An object oriented language may be used.

메모리 장치(13)에서 데이터가 저장될 공간은 복수의 메모리 공간들로 표현될 수 있다. 예를 들어, 메모리 장치(13)는 루트 세트(root set) 및 힙(heap) 공간을 포함할 수 있다. 힙 공간은 영 제너레이션 및 올드 제너레이션을 포함할 수 있다. 영 제너레이션은 에덴 공간, 서바이벌-투 공간, 및 서바이벌-프롬 공간을 포함할 수 있다. 올드 제너레이션은 테뉴어드 공간을 포함할 수 있다. 루트 세트(root set)는 힙 공간 밖에 존재하는 루트 객체들의 집합일 수 있다. 루트 객체는 힙 공간에 존재하는 객체에 액세스할 수 있다.A space in which data is to be stored in the memory device 13 may be expressed as a plurality of memory spaces. For example, the memory device 13 may include a root set and a heap space. Heap space can contain young generation and old generation. The Young Generation may include an Eden space, a survival-to-space, and a survival-from space. The Old Generation may contain tenured spaces. A root set may be a set of root objects existing outside the heap space. The root object can access objects that exist in heap space.

살아있는 객체는 흰색으로 도시되고, 죽은 객체는 음영으로 도시된다. 한 쌍의 객체들 사이의 실선 화살표는 참조 관계를 의미할 수 있다. 한 쌍의 객체들 사이의 점선 화살표는 객체의 이동을 의미할 수 있다. Live objects are shown in white, and dead objects are shown in shade. A solid line arrow between a pair of objects may mean a reference relationship. A dotted line arrow between a pair of objects may indicate movement of the object.

객체가 살아있다는 것은 메모리 공간이 사용되는 것을 의미할 수 있다. 살아있는 객체는 루트 세트로부터 직접적으로 또는 간접적으로 참조되는 객체일 수 있다. 객체가 죽었다는 것은 메모리 공간이 더 이상 사용되지 않는 것을 의미할 수 있다. 죽어있는 객체는 루트 세트로부터 참조되지 않는 객체일 수 있다. Keeping an object alive can mean that memory space is being used. A living object can be an object that is directly or indirectly referenced from the root set. When an object dies, it can mean that the memory space is no longer used. A dead object can be an object that is not referenced from the root set.

예를 들어, 필요에 의해 객체가 메모리 공간에 할당되었으나, 이 후 애플리케이션의 동작에 따라 객체에 대응하는 데이터가 더 이상 필요하지 않을 수 있다. 필요하지 않게 된 객체라도, 할당된 공간이 해제되기 전까지 메모리 공간을 점유할 수 있다. 가비지 컬렉션 장치(100)는 이러한 불필요한 메모리 공간을 해제함으로써, 메모리 공간의 활용률을 높일 수 있다.For example, an object may be allocated to a memory space as needed, but data corresponding to the object may no longer be needed according to an application operation thereafter. Even objects that are no longer needed can occupy memory space until the allocated space is freed. The garbage collection apparatus 100 can increase the utilization rate of memory space by releasing unnecessary memory space.

가비지 컬렉션 장치(100)는 루트 세트로부터의 객체를 트래버스(traverse) 할 수 있다. 트래버스는 루트 세트에 포함된 루트 객체들 중 적어도 하나로부터 참조되는 객체들을 연쇄적으로 찾는 동작을 의미할 수 있다. 예를 들어, 가비지 컬렉션 장치(100)는 루트 세트로부터 객체들(OJ5, OJ4, OJ3, OJ2, OJ1)을 연쇄적으로 찾을 수 있다. 루트 세트로부터 직접적으로 참조되는 객체는 에덴 공간에 존재할 수 있다. 예를 들어, 루트 세트로부터 직접적으로 참조되는 객체(OJ5)는 에덴 공간에 존재할 수 있다.The garbage collection apparatus 100 may traverse objects from the root set. Traversing may refer to an operation of sequentially finding objects referenced from at least one of root objects included in a root set. For example, the garbage collection apparatus 100 may serially find objects OJ5 , OJ4 , OJ3 , OJ2 , and OJ1 from the root set. Objects referenced directly from the root set may exist in Eden space. For example, an object OJ5 that is directly referenced from the root set may exist in the Eden space.

가비지 컬렉션 장치(100)는 살아있는 객체를 카피할 수 있다. 카피는 영 제너레이션 내 메모리 공간에서 객체를 복제하는 것일 수 있다. 예를 들어, 가비지 컬렉션 장치(100)는 에덴 공간에 포함된 객체(OJ5)를 서바이벌-투 공간으로 카피할 수 있다. 객체(OJ5)는 루트 세트로부터 참조되는 살아있는 객체일 수 있다. 가비지 컬렉션 장치(100)는 서바이벌-프롬 공간에 포함된 객체(OJ2)를 서바이벌-투 공간으로 카피할 수 있다. 객체(OJ2)는 객체들(OJ3, OJ4, OJ5) 및 루트 세트에 의해 참조되는 살아있는 객체일 수 있다. The garbage collection apparatus 100 may copy living objects. Copying can be duplication of an object in memory space within the zero generation. For example, the garbage collection apparatus 100 may copy the object OJ5 included in the Eden space to the survival-to-space. Object OJ5 may be a live object referenced from the root set. The garbage collection apparatus 100 may copy the object OJ2 included in the survival-from space to the survival-to space. Object OJ2 may be a living object referenced by objects OJ3, OJ4, OJ5 and a root set.

예시적인 실시 예에서, 서바이벌-투 공간 및 서바이벌-프롬 공간은 서로 바뀔 수 있다. 예를 들어, 도 2a에서 카피하는 것(copying)으로 도시된 가비지 컬렉션 이후의 다른 가비지 컬렉션이 수행되는 경우, 서바이벌-투 공간에 있는 살아있는 객체가 서바이벌-프롬 공간으로 카피될 수 있다. In an exemplary embodiment, a survival-to-space and a survival-from space may be interchanged. For example, if another garbage collection after the garbage collection shown as copying in FIG. 2A is performed, a living object in the survival-to-space may be copied to the survival-from space.

가비지 컬렉션 장치(100)는 영 제너레이션 내에서 기준 횟수를 초과하는 가비지 컬렉션을 거친 후 살아있는 객체를 프로모트(promote) 시킬 수 있다. 프로모트는 영 제너레이션 내 메모리 공간으로부터 올드 제너레이션 내 메모리 공간으로 이동시키는 것을 의미할 수 있다. 예를 들어, 가비지 컬렉션 장치(100)는 객체(OJ2)보다 오랫동안 살아있는(즉, 기준 횟수를 초과하는 가비지 컬렉션을 겪은 후에도 살아있는) 객체(OJ1)을 서바이벌-투 공간으로 카피하는 대신, 올드 제너레이션 내에서의 테뉴어드(tenured) 공간으로 프로모트 시킬 수 있다. The garbage collection apparatus 100 may promote a living object after undergoing garbage collection exceeding a reference number of times within zero generation. Promoting can mean moving from a memory space in the young generation to a memory space in the old generation. For example, the garbage collection apparatus 100 copies an object OJ1 that lives longer than the object OJ2 (that is, lives even after being subjected to garbage collection exceeding a reference number of times) to the survival-to-space, in the old generation. can be promoted to a tenured space in

가비지 컬렉션 장치(100)는 테뉴어드 공간 내에서 살아있는 객체들을 컴팩션(compaction)시킬 수 있다. 컴팩션은 올드 제너레이션 공간 내에서 살아있는 객체가 다른 살아있는 객체에 인접하도록 이동시키는 것일 수 있다. 컴팩션에 의해 메모리 공간의 파편화(fragmentation)를 감소시킬 수 있다. 예를 들어, 객체(OJc)는 테뉴어드 공간으로 프로모트 된 다음에 죽은 객체가 될 수 있다. 즉, 테뉴어드 공간 내에서, 객체(OJc)는 불필요할 수 있다. 가비지 컬렉션 장치(100)는 살아있는 객체(OJd)를 다른 살아있는 객체(OJb)에 인접하도록 이동시킬 수 있다. 즉, 가비지 컬렉션 장치(100)는 테뉴어드 공간 내에서 살아있는 객체들을 컴팩션 시킬 수 있다. The garbage collection apparatus 100 may compact live objects in the tenured space. Compaction can be moving a live object to be adjacent to another live object within the old generation space. Fragmentation of memory space can be reduced by compaction. For example, the object OJc may be promoted to the tenured space and then become a dead object. That is, within the tenured space, the object OJc may be unnecessary. The garbage collection apparatus 100 may move the living object OJd to be adjacent to another living object OJb. That is, the garbage collection apparatus 100 may compact live objects within the tenured space.

한편, 도면의 복잡함을 피하기 위해, 테뉴어드 공간에서 객체들(OJa, OJb, OJd)의 참조 관계를 나타내는 화살표가 생략되었으나, 테뉴어드 공간에서 살아있는 객체들(OJa, OJb, OJd)은 루트 세트로부터 직접적으로 또는 간접적으로 참조될 수 있다. 한편, 테뉴어드 공간에서 죽은 객체(OJc)는 루트 세트에 의해 참조되지 않을 수 있다. 가비지 컬렉션 장치(100)가 컴팩션 동작을 수행한 후에, 죽은 객체(OJc)는 할당 해제될 수 있다.On the other hand, in order to avoid the complexity of the drawing, arrows representing the reference relationships of the objects OJa, OJb, and OJd in the tenured space are omitted, but the living objects OJa, OJb, and OJd in the tenured space are separated from the root set. Reference may be made either directly or indirectly. On the other hand, dead objects OJc in the tenured space may not be referenced by the root set. After the garbage collection apparatus 100 performs a compaction operation, the dead object OJc may be deallocated.

예시적인 실시 예에서, 가비지 컬렉션 장치(100)는 마이너(minor) 가비지 컬렉션을 수행할 수 있다. 예를 들어, 마이너 가비지 컬렉션은 영 제너레이션 내에서 살아있는 객체들을 서바이벌-투 공간으로 카피하고, 나머지 객체들의 할당을 해제하는 것일 수 있다. 마이너 가비지 컬렉션에 대한 보다 상세한 설명은 도 10과 함께 후술될 것이다.In an exemplary embodiment, the garbage collection apparatus 100 may perform minor garbage collection. For example, minor garbage collection may be copying living objects within the zero generation to the survival-to-space and deallocating remaining objects. A more detailed description of the minor garbage collection will be described later along with FIG. 10 .

예시적인 실시 예에서, 가비지 컬렉션 장치(100)는 메이저(major) 가비지 컬렉션을 수행할 수 있다. 예를 들어, 메이저 가비지 컬렉션은 살아있는 객체들을 마크(mark)하고, 올드 제너레이션 내에서 객체들을 컴팩션 시키는 것일 수 있다. 메이저 가비지 컬렉션에 소요되는 시간은 마이너 가비지 컬렉션에 소요되는 시간보다 길 수 있다. 메이저 가비지 컬렉션에 대한 보다 상세한 설명은 도 11과 함께 후술될 것이다.In an exemplary embodiment, the garbage collection apparatus 100 may perform a major garbage collection. For example, major garbage collection can mark live objects and compact objects within the old generation. Major garbage collection takes longer than minor garbage collection. A more detailed description of major garbage collection will be described later along with FIG. 11 .

도 2b는 도 2a의 메모리 공간들을 예시적으로 설명하는 도면이다. 도 2b를 참조하면, 도 2a에서의 메모리 공간이 예시적으로 구체화된다. 예를 들어, 도 2b에서 도시된 공간은 힙 공간의 적어도 일부를 개념적으로 도시한 것일 수 있다. 한편, 도 2a의 루트 세트에 포함된 루트 객체들 중 적어도 하나는 힙 공간(예를 들어, 에덴 공간)에 존재하는 객체를 참조할 수 있다.FIG. 2B is a diagram illustrating the memory spaces of FIG. 2A by way of example. Referring to FIG. 2B , the memory space in FIG. 2A is exemplarily specified. For example, the space shown in FIG. 2B may conceptually show at least a portion of the heap space. Meanwhile, at least one of the root objects included in the root set of FIG. 2A may refer to an object existing in a heap space (eg, Eden space).

도 2b에서 도시되는 메모리 공간은 영 제너레이션 및 올드 제너레이션을 포함할 수 있다. 영 제너레이션은 에덴 공간 및 서바이벌 공간을 포함할 수 있다. 서바이벌 공간은 제1 서바이벌 공간 및 제2 서바이벌 공간을 포함할 수 있다. 예를 들어, 제1 서바이벌 공간은 도 2a의 서바이벌-프롬 공간일 수 있고, 제2 서바이벌 공간은 도 2a의 서바이벌-투 공간일 수 있다. The memory space shown in FIG. 2B may include a zero generation and an old generation. The Young Generation may include an Eden space and a survival space. The survival space may include a first survival space and a second survival space. For example, the first survival space may be the survival-from space of FIG. 2A, and the second survival space may be the survival-to-space of FIG. 2A.

예시적인 실시 예에서, 가비지 컬렉션이 수행되는 횟수에 따라, 서바이벌-프롬 공간 및 서바이벌-투 공간은 서로 바뀔 수 있다. 예를 들어, 제1 가비지 컬렉션에서, 제1 서바이벌 공간이 서바이벌-프롬 공간이고, 제2 서바이벌 공간이 서바이벌-투 공간일 수 있다. 제1 가비지 컬렉션 이후의 제2 가비지 컬렉션에서, 제1 서바이벌 공간이 서바이벌-투 공간이고, 제2 서바이벌 공간이 서바이벌-프롬 공간일 수 있다.In an exemplary embodiment, the survival-from space and the survival-to space may be interchanged according to the number of times garbage collection is performed. For example, in the first garbage collection, the first survival space may be a survival-from space, and the second survival space may be a survival-to-space. In the second garbage collection after the first garbage collection, the first survival space may be a survival-to-space, and the second survival space may be a survival-from space.

올드 제너레이션은 테뉴어드 공간을 포함할 수 있다. 테뉴어드 공간에 있는 객체들은 기준 횟수를 초과하는 가비지 컬렉션을 거친 후 살아있는 객체들일 수 있다. 테뉴어드 공간으로 이동된 후 죽은 객체는 메이저 가비지 컬렉션에 의해 할당 해제될 수 있다. The Old Generation may contain tenured spaces. Objects in the tenured space may be living objects after garbage collection exceeding the standard number of times. Objects that die after being moved into tenured space can be deallocated by major garbage collection.

도 3은 본 발명의 실시 예에 따른 가비지 컬렉션 장치(100)를 예시적으로 보여주는 블록도이다. 도 3을 참조하면, 가비지 컬렉션 장치(100)는 호스트 및 메모리 장치와 연결될 수 있다. 예를 들어, 가비지 컬렉션 장치(100)는 도 1의 메모리 시스템(10)의 메모리 컨트롤러(12)에 포함될 수 있다.3 is a block diagram showing a garbage collection apparatus 100 according to an exemplary embodiment of the present invention. Referring to FIG. 3 , the garbage collection device 100 may be connected to a host and a memory device. For example, the garbage collection device 100 may be included in the memory controller 12 of the memory system 10 of FIG. 1 .

가비지 컬렉션 장치(100)는 호스트 인터페이스 회로(110), 카피 서치 유닛(120), 비트맵 카운트 유닛(130), 스캔 푸시 유닛(140), 및 메모리 인터페이스 회로(150)를 포함할 수 있다. 가비지 컬렉션 장치(100)는 호스트의 제어에 따라 메모리 장치의 객체들에 대한 가비지 컬렉션을 수행할 수 있다.The garbage collection device 100 may include a host interface circuit 110 , a copy search unit 120 , a bitmap count unit 130 , a scan push unit 140 , and a memory interface circuit 150 . The garbage collection device 100 may perform garbage collection on objects of a memory device under control of a host.

호스트 인터페이스 회로(110)는 호스트, 카피 서치 유닛(120), 비트맵 카운트 유닛(130), 및 스캔 푸시 유닛(140)과 연결될 수 있다. 호스트 인터페이스 회로(110)는 호스트의 제어에 따라, 카피 서치 유닛(120)에 제1 커맨드(CMD1)를 전송하고, 비트맵 카운트 유닛(130)에 제2 커맨드(CMD2)를 전송하고, 그리고 스캔 푸시 유닛(140)에 제3 커맨드(CMD3)를 전송할 수 있다. 호스트 인터페이스 회로(110)는 제1 내지 제3 커맨드들(CMD1~CMD3) 중 적어도 하나에 대응하는 리턴 값을 호스트로 출력할 수 있다.The host interface circuit 110 may be connected to the host, the copy search unit 120 , the bitmap count unit 130 , and the scan push unit 140 . The host interface circuit 110 transmits the first command CMD1 to the copy search unit 120 and the second command CMD2 to the bitmap count unit 130 under the control of the host, and scan A third command CMD3 may be transmitted to the push unit 140 . The host interface circuit 110 may output a return value corresponding to at least one of the first to third commands CMD1 to CMD3 to the host.

카피 서치 유닛(120)은 호스트 인터페이스 회로(110) 및 메모리 인터페이스 회로(150)와 연결될 수 있다. 카피 서치 유닛(120)은 호스트 인터페이스 회로(110)를 통해 수신된 제1 커맨드(CMD1)를 기반으로, 메모리 인터페이스 회로(150)에 제1 요청 신호(RQ1)를 출력할 수 있다. 카피 서치 유닛(120)은 메모리 인터페이스 회로(150)로부터 제1 요청 신호(RQ1)에 대응하는 제1 응답 신호(RP1)를 수신할 수 있다.The copy search unit 120 may be connected to the host interface circuit 110 and the memory interface circuit 150 . The copy search unit 120 may output the first request signal RQ1 to the memory interface circuit 150 based on the first command CMD1 received through the host interface circuit 110 . The copy search unit 120 may receive the first response signal RP1 corresponding to the first request signal RQ1 from the memory interface circuit 150 .

카피 서치 유닛(120)은 제1 응답 신호(RP1)를 기반으로, 카피 동작을 수행하거나, 또는 서치 동작을 수행할 수 있다. 카피 동작은 객체의 새로 할당될 메모리 공간의 어드레스를 생성하는 것일 수 있다. 서치 동작은 객체가 다른 객체에 의해 참조되는지 여부를 판별하고, 판별 여부를 가리키는 리턴 값을 호스트로 출력하는 것일 수 있다. The copy search unit 120 may perform a copy operation or a search operation based on the first response signal RP1. The copy operation may be generating an address of a memory space to be newly allocated for an object. The search operation may determine whether an object is referenced by another object, and output a return value indicating whether or not the object is referenced to the host.

비트맵 카운트 유닛(130)은 호스트 인터페이스 회로(110) 및 메모리 인터페이스 회로(150)와 연결될 수 있다. 비트맵 카운트 유닛(130)은 호스트 인터페이스 회로(110)를 통해 수신된 제2 커맨드(CMD2)를 기반으로, 메모리 인터페이스 회로(150)로 제2 요청 신호(RQ2)를 출력할 수 있다. 비트맵 카운트 유닛(130)은 메모리 인터페이스 회로(150)로부터 제2 요청 신호(RQ2)에 대응하는 제2 응답 신호(RP2)를 수신할 수 있다.The bitmap count unit 130 may be connected to the host interface circuit 110 and the memory interface circuit 150 . The bitmap count unit 130 may output the second request signal RQ2 to the memory interface circuit 150 based on the second command CMD2 received through the host interface circuit 110 . The bitmap count unit 130 may receive the second response signal RP2 corresponding to the second request signal RQ2 from the memory interface circuit 150 .

비트맵 카운트 유닛(130)은 제2 응답 신호(RP2)를 기반으로, 비트맵 카운트 동작을 수행할 수 있다. 비트맵은 메모리 공간을 비트 타입으로 표현한 데이터일 수 있다. 예를 들어, 비트맵은 힙 공간에서, 살아있는 객체에 대응하는 메모리 공간은 제1 값(예를 들어, '1')으로 표현하고, 죽은 객체에 대응하는 메모리 공간 또는 할당되지 않은 메모리 공간은 제2 값(예를 들어, '0')으로 표현한 데이터일 수 있다.The bitmap count unit 130 may perform a bitmap count operation based on the second response signal RP2. The bitmap may be data expressing a memory space in a bit type. For example, in the bitmap, in the heap space, a memory space corresponding to a live object is represented by a first value (eg, '1'), and a memory space corresponding to a dead object or an unallocated memory space is second. It may be data expressed as a value of 2 (eg '0').

비트맵 카운트 동작은 비트맵에 대응하는 메모리 공간 내에서 살아있는 객체의 크기 정보를 획득하고, 살아있는 객체의 크기 정보를 포함하는 비트 카운트 값을 호스트로 출력하는 것일 수 있다. 예를 들어, 비트 카운트 값은 힙 공간에서 살아있는 모든 객체들의 크기들의 합을 가리키는 정수(integer) 타입의 데이터일 수 있다.The bitmap count operation may be to obtain size information of a living object in a memory space corresponding to the bitmap and output a bit count value including the size information of the living object to the host. For example, the bit count value may be data of an integer type indicating the sum of the sizes of all living objects in the heap space.

예시적인 실시 예에서, 비트맵 카운트 동작은 메이저 가비지 컬렉션을 위해 수행될 수 있다. 예를 들어, 비트맵 카운트 동작을 기반으로 획득된 비트 카운트 값은 컴팩션 동작에서 살아있는 객체들을 새로운 메모리 영역으로 이동시키기 위해 사용될 수 있다. In an example embodiment, the bitmap count operation may be performed for major garbage collection. For example, a bit count value obtained based on a bitmap count operation may be used to move living objects to a new memory area in a compaction operation.

스캔 푸시 유닛(140)은 호스트 인터페이스 회로(110) 및 메모리 인터페이스 회로(150)와 연결될 수 있다. 스캔 푸시 유닛(140)은 호스트 인터페이스 회로(110)를 통해 수신된 제3 커맨드(CMD3)를 기반으로, 메모리 인터페이스 회로(150)로 제3 요청 신호(RQ3)를 출력할 수 있다. 스캔 푸시 유닛(140)은 메모리 인터페이스 회로(150)로부터 제3 요청 신호(RQ3)에 대응하는 제3 응답 신호(RP3)를 수신할 수 있다.The scan push unit 140 may be connected to the host interface circuit 110 and the memory interface circuit 150 . The scan push unit 140 may output the third request signal RQ3 to the memory interface circuit 150 based on the third command CMD3 received through the host interface circuit 110 . The scan push unit 140 may receive the third response signal RP3 corresponding to the third request signal RQ3 from the memory interface circuit 150 .

스캔 푸시 유닛(140)은 제3 응답 신호(RP3)를 기반으로, 스캔 동작을 수행하고, 그리고 푸시(push) 동작을 수행할 수 있다. 스캔 동작은 객체의 필드에서 마크 여부를 확인하는 것일 수 있다. 예를 들어, 객체의 마크 여부는 다른 객체에 의해 참조되는지(즉, 살아있는지) 여부를 가리킬 수 있다. 푸시는 객체를 스택(stack) 메모리에 저장하는 것일 수 있다. 스택 메모리는 함수의 호출과 관련된 지역 변수 및 매개변수가 저장되는 메모리 공간일 수 있다. The scan push unit 140 may perform a scan operation and then a push operation based on the third response signal RP3. The scan operation may be to check whether a field of an object is marked. For example, whether an object is marked may indicate whether it is referenced by other objects (ie, alive). Pushing may be storing an object in a stack memory. The stack memory may be a memory space in which local variables and parameters related to function calls are stored.

예시적인 실시 예에서, 마이너 가비지 컬렉션을 수행하는 경우, 스캔 푸시 유닛(140)은 객체의 필드를 참조하여 객체의 마크 여부를 확인할 수 있다. 객체가 마크되었으면, 객체의 메타데이터를 갱신할 수 있다. 객체가 마크되지 않았으면, 객체를 스택 메모리에 푸시할 수 있다.In an exemplary embodiment, when minor garbage collection is performed, the scan push unit 140 may check whether an object is marked by referring to a field of the object. Once an object has been marked, the object's metadata can be updated. If the object is unmarked, it can be pushed onto the stack memory.

예시적인 실시 예에서, 메이저 가비지 컬렉션을 수행하는 경우, 스캔 푸시 유닛(140)은 객체의 필드를 참조하여 객체의 마크 여부를 확인할 수 있다. 객체가 마크되었으면, 객체의 메타데이터를 갱신할 수 있다. 객체가 마크되지 않았으면, 비트맵을 참조하여 살아있는 객체를 마크하고, 새로 마크된 객체를 스택 메모리에 푸시할 수 있다.In an exemplary embodiment, when major garbage collection is performed, the scan push unit 140 may check whether an object is marked by referring to a field of the object. Once an object has been marked, the object's metadata can be updated. If the object is unmarked, we can refer to the bitmap to mark the live object, and push the newly marked object onto the stack memory.

메모리 인터페이스 회로(150)는 메모리 장치, 카피 서치 유닛(120), 비트맵 카운트 유닛(130), 및 스캔 푸시 유닛(140)과 연결될 수 있다. 메모리 인터페이스 회로(150)는 카피 서치 유닛(120)으로부터 메모리 장치로 제1 요청 신호(RQ1)를 전송할 수 있다. 메모리 인터페이스 회로(150)는 메모리 장치로부터 카피 서치 유닛(120)으로 제1 요청 신호(RQ1)에 대응하는 제1 응답 신호(RP1)를 전송할 수 있다.The memory interface circuit 150 may be connected to the memory device, the copy search unit 120 , the bitmap count unit 130 , and the scan push unit 140 . The memory interface circuit 150 may transmit the first request signal RQ1 from the copy search unit 120 to the memory device. The memory interface circuit 150 may transmit a first response signal RP1 corresponding to the first request signal RQ1 from the memory device to the copy search unit 120 .

메모리 인터페이스 회로(150)는 비트맵 카운트 유닛(130)으로부터 메모리 장치로 제2 요청 신호(RQ2)를 전송할 수 있다. 메모리 인터페이스 회로(150)는 메모리 장치로부터 비트맵 카운트 유닛(130)으로 제2 요청 신호(RQ2)에 대응하는 제2 응답 신호(RP2)를 전송할 수 있다.The memory interface circuit 150 may transmit the second request signal RQ2 from the bitmap count unit 130 to the memory device. The memory interface circuit 150 may transmit the second response signal RP2 corresponding to the second request signal RQ2 from the memory device to the bitmap count unit 130 .

메모리 인터페이스 회로(150)는 스캔 푸시 유닛(140)으로부터 메모리 장치로 제3 요청 신호(RQ3)를 전송할 수 있다. 메모리 인터페이스 회로(150)는 메모리 장치로부터 스캔 푸시 유닛(140)으로 제3 요청 신호(RQ3)에 대응하는 제3 응답 신호(RP3)를 전송할 수 있다.The memory interface circuit 150 may transmit the third request signal RQ3 from the scan push unit 140 to the memory device. The memory interface circuit 150 may transmit a third response signal RP3 corresponding to the third request signal RQ3 from the memory device to the scan push unit 140 .

도 4는 도 3의 호스트 인터페이스 회로(110)를 예시적으로 구체화한 도면이다. 도 4를 참조하면, 호스트 인터페이스 회로(110)는 메인 커맨드 큐(111), 제1 커맨드 큐(112a), 제2 커맨드 큐(112b), 제3 커맨드 큐(112c), 및 리턴 큐(113)를 포함할 수 있다.FIG. 4 is an illustrative embodiment of the host interface circuit 110 of FIG. 3 . Referring to FIG. 4 , the host interface circuit 110 includes a main command queue 111, a first command queue 112a, a second command queue 112b, a third command queue 112c, and a return queue 113. can include

메인 커맨드 큐(111)는 호스트로부터 제1 내지 제3 커맨드들(CMD1~CMD3) 중 적어도 하나를 수신할 수 있다. 메인 커맨드 큐(111)는 제1 내지 제3 커맨드 큐들(112a~112c)과 연결될 수 있다.The main command queue 111 may receive at least one of the first to third commands CMD1 to CMD3 from the host. The main command queue 111 may be connected to the first to third command queues 112a to 112c.

제1 커맨드 큐(112a)는 메인 커맨드 큐(111)로부터 수신된 제1 커맨드(CMD1)를 카피 서치 유닛(120)으로 출력할 수 있다. 제2 커맨드 큐(112b)는 메인 커맨드 큐(111)로부터 수신된 제2 커맨드(CMD2)를 비트맵 카운트 유닛(130)으로 출력할 수 있다. 제3 커맨드 큐(112c)는 메인 커맨드 큐(111)로부터 수신된 제3 커맨드(CMD3)를 스캔 푸시 유닛(140)으로 출력할 수 있다.The first command queue 112a may output the first command CMD1 received from the main command queue 111 to the copy search unit 120 . The second command queue 112b may output the second command CMD2 received from the main command queue 111 to the bitmap count unit 130 . The third command queue 112c may output the third command CMD3 received from the main command queue 111 to the scan push unit 140 .

리턴 큐(113)는 호스트와 연결될 수 있다. 리턴 큐(113)는 카피 서치 유닛(120), 비트맵 카운트 유닛(130), 및 스캔 푸시 유닛(140) 중 적어도 하나와 연결될 수 있다. 리턴 큐(113)는 카피 서치 유닛(120), 비트맵 카운트 유닛(130), 및 스캔 푸시 유닛(140) 중 적어도 하나로부터 리턴 값을 수신하고, 호스트로 리턴 값을 출력할 수 있다. 예를 들어, 리턴 값은 카피 서치 유닛(120)으로부터 출력된 객체의 다른 객체에 의한 참조 여부를 가리키는 값일 수 있다. 예를 들어, 리턴 값은 비트맵 카운트 유닛(130)으로부터 출력된 메모리 공간 내에서 살아있는 객체의 크기 정보를 포함하는 비트 카운트 값일 수 있다. The return queue 113 may be connected to a host. The return queue 113 may be connected to at least one of the copy search unit 120 , the bitmap count unit 130 , and the scan push unit 140 . The return queue 113 may receive a return value from at least one of the copy search unit 120, the bitmap count unit 130, and the scan push unit 140, and may output the return value to the host. For example, the return value may be a value indicating whether an object output from the copy search unit 120 is referenced by another object. For example, the return value may be a bit count value including size information of a living object in the memory space output from the bitmap count unit 130 .

도 5는 도 3의 카피 서치 유닛(120)을 예시적으로 구체화한 블록도이다. 도 5를 참조하면, 카피 서치 유닛(120)은 제1 요청 생성기(121), 카피 서치 모듈(122), 어드레스 계산기(123), 및 객체 판별기(124)를 포함할 수 있다. FIG. 5 is a block diagram exemplarily embodying the copy search unit 120 of FIG. 3 . Referring to FIG. 5 , the copy search unit 120 may include a first request generator 121 , a copy search module 122 , an address calculator 123 , and an object determiner 124 .

제1 요청 생성기(121)는 호스트로부터 제1 커맨드 큐(112a)를 통해 제1 커맨드(CMD1)를 수신할 수 있다. 제1 요청 생성기(121)는 제1 커맨드(CMD1)를 기반으로 제1 요청 신호(RQ1)를 메모리 인터페이스 회로(150)로 출력할 수 있다. 메모리 인터페이스 회로(150)는 제1 요청 신호(RQ1)를 메모리 장치로 전송할 수 있다. 메모리 장치는 제1 요청 신호(RQ1)에 응답하여 제1 응답 신호(RP1)를 메모리 인터페이스 회로(150)로 출력할 수 있다. The first request generator 121 may receive the first command CMD1 from the host through the first command queue 112a. The first request generator 121 may output the first request signal RQ1 to the memory interface circuit 150 based on the first command CMD1 . The memory interface circuit 150 may transmit the first request signal RQ1 to the memory device. The memory device may output the first response signal RP1 to the memory interface circuit 150 in response to the first request signal RQ1.

카피 서치 모듈(122)은 메모리 장치로부터 메모리 인터페이스 회로(150)를 통해 제1 응답 신호(RP1)를 수신할 수 있다. 카피 서치 모듈(122)은 제1 응답 신호(RP1)를 기반으로, 카피 정보 신호(CPI) 또는 서치 정보 신호(SRI)를 생성할 수 있다. 카피 정보 신호(CPI)는 카피 전 객체가 시작되는 어드레스, 카피 후 객체가 시작되는 어드레스, 및 객체의 크기 정보를 포함할 수 있다. 서치 정보 신호(SRI)는 서치 동작을 수행할 범위가 시작되는 어드레스 및 범위가 끝나는 어드레스를 포함할 수 있다. The copy search module 122 may receive the first response signal RP1 from the memory device through the memory interface circuit 150 . The copy search module 122 may generate a copy information signal CPI or a search information signal SRI based on the first response signal RP1. The copy information signal CPI may include an object starting address before copying, an object starting address after copying, and object size information. The search information signal SRI may include an address where a range to perform a search operation starts and an address where the range ends.

어드레스 계산기(123)는 카피 서치 모듈(122)로부터 카피 정보 신호(CPI)를 수신할 수 있다. 어드레스 계산기(123)는 카피 정보 신호(CPI)를 기반으로 카피된 객체에 대응하는 어드레스(ADDc)를 생성할 수 있다. 어드레스 계산기(123)는 카피된 객체에 대응하는 어드레스(ADDc)를 메모리 인터페이스 회로(150)를 통해 메모리 장치로 출력할 수 있다.The address calculator 123 may receive the copy information signal CPI from the copy search module 122 . The address calculator 123 may generate an address ADDc corresponding to the copied object based on the copy information signal CPI. The address calculator 123 may output the address ADDc corresponding to the copied object to the memory device through the memory interface circuit 150 .

객체 판별기(124)는 카피 서치 모듈(122)로부터 서치 정보 신호(SRI)를 수신할 수 있다. 객체 판별기(124)는 서치 정보 신호(SRI)를 기반으로 객체가 다른 객체에 의해 참조되는지를 판별하고, 서치 값을 포함하는 제1 리턴 신호(RET1)를 리턴 큐(113)를 통해 호스트로 출력할 수 있다. The object determiner 124 may receive the search information signal SRI from the copy search module 122 . The object determiner 124 determines whether the object is referenced by another object based on the search information signal SRI, and sends a first return signal RET1 including the search value to the host through the return queue 113. can be printed out.

예시적인 실시 예에서, 서치 값은 객체가 다른 객체에 의해 참조되는지를 가리키는 불(bool) 타입의 데이터일 수 있다. 예를 들어, 객체가 다른 객체에 의해 참조되면, 서치 값은 제1 값(예를 들어, '1' 또는 'true')을 가질 수 있다. 예를 들어, 객체가 다른 객체에 의해 참조되지 않으면, 서치 값은 제2 값(예를 들어, '0' 또는 'false')을 가질 수 있다.In an exemplary embodiment, the search value may be boolean data indicating whether an object is referenced by another object. For example, if an object is referenced by another object, the search value may have a first value (eg, '1' or 'true'). For example, if the object is not referenced by another object, the search value may have a second value (eg '0' or 'false').

도 6a는 도 3의 비트맵 카운트 유닛(130)을 예시적으로 구체화한 블록도이다. 도 6a를 참조하면, 비트맵 카운트 유닛(130)은 제2 요청 생성기(131), 비긴 맵 모듈(132), 엔드 맵 모듈(133), 감산기(134), 및 카운터 회로(135)를 포함할 수 있다.FIG. 6A is a block diagram of an exemplary embodiment of the bitmap count unit 130 of FIG. 3 . Referring to FIG. 6A , the bitmap count unit 130 may include a second request generator 131, a draw map module 132, an end map module 133, a subtractor 134, and a counter circuit 135. can

제2 요청 생성기(131)는 호스트로부터 제2 커맨드 큐(112b)를 통해 제2 커맨드(CMD2)를 수신할 수 있다. 제2 요청 생성기(131)는 제2 커맨드(CMD2)를 기반으로 제2 요청 신호(RQ2)를 메모리 인터페이스 회로(150)로 출력할 수 있다. 메모리 인터페이스 회로(150)는 제2 요청 신호(RQ2)를 메모리 장치로 전송할 수 있다. 메모리 장치는 제2 요청 신호(RQ2)에 응답하여 제2 응답 신호(RP2)를 메모리 인터페이스 회로(150)로 출력할 수 있다. The second request generator 131 may receive the second command CMD2 from the host through the second command queue 112b. The second request generator 131 may output the second request signal RQ2 to the memory interface circuit 150 based on the second command CMD2 . The memory interface circuit 150 may transmit the second request signal RQ2 to the memory device. The memory device may output the second response signal RP2 to the memory interface circuit 150 in response to the second request signal RQ2.

예시적인 실시 예에서, 제2 응답 신호(RP2)는 비트맵을 포함할 수 있다. 비트맵은 메모리 공간(예를 들어, 힙 공간)에서 살아있는 객체들을 제1 값으로 표시하고 죽은 객체들 또는 할당되지 않은 메모리 공간을 제2 값으로 표시한 데이터일 수 있다. 보다 상세하게는, 비트맵은 메모리 공간을 '8' 바이트(byte) 단위의 서브 메모리 공간으로 분할하여, 살아있는 객체들이 할당된 서브 메모리 공간을 '1'로 표현하고, 객체들이 할당되지 않은 나머지 서브 메모리 공간을 '0'으로 표현한 것일 수 있다.In an exemplary embodiment, the second response signal RP2 may include a bitmap. The bitmap may be data representing living objects in a memory space (eg, heap space) as a first value and dead objects or an unallocated memory space as a second value. More specifically, the bitmap divides the memory space into '8' byte sub-memory spaces, represents the sub-memory space to which living objects are allocated as '1', and the remaining sub-memory spaces to which objects are not allocated. It may represent the memory space as '0'.

비긴 맵 모듈(132)은 메모리 인터페이스 회로(150)로부터 제2 응답 신호(RP2)를 수신할 수 있다. 비긴 맵 모듈(132)은 제2 응답 신호(RP2)를 기반으로 비긴 맵을 생성할 수 있다. 비긴 맵은 메모리 장치의 메모리 공간(예를 들어, 힙 공간)에서 살아있는 객체가 시작되는 위치를 포함할 수 있다. 비긴 맵 모듈(132)은 비긴 맵에 대응하는 제1 카운트 값(CTV1)을 생성할 수 있다.The match map module 132 may receive the second response signal RP2 from the memory interface circuit 150 . The tied map module 132 may generate a tied map based on the second response signal RP2. The drawn map may include a starting location of a living object in a memory space (eg, a heap space) of a memory device. The tied map module 132 may generate a first count value CTV1 corresponding to the tied map.

엔드 맵 모듈(133)은 메모리 인터페이스 회로(150)로부터 제2 응답 신호(RP2)를 수신할 수 있다. 엔드 맵 모듈(133)은 제2 응답 신호(RP2)를 기반으로 엔드 맵을 생성할 수 있다. 엔드 맵은 메모리 장치의 메모리 공간(예를 들어, 힙 공간)에서 살아있는 객체가 끝나는 위치를 포함할 수 있다. 엔드 맵 모듈(133)은 엔드 맵에 대응하는 제2 카운트 값(CTV2)을 생성할 수 있다. The end map module 133 may receive the second response signal RP2 from the memory interface circuit 150 . The end map module 133 may generate an end map based on the second response signal RP2. The end map may include a location where a living object ends in a memory space (eg, heap space) of a memory device. The end map module 133 may generate a second count value CTV2 corresponding to the end map.

감산기(134)는 비긴 맵 모듈(132)로부터 제1 카운트 값(CTV1)을 수신할 수 있다. 감산기(134)는 엔드 맵 모듈(133)로부터 제2 카운트 값(CTV2)을 수신할 수 있다. 감산기(134)는 제1 카운트 값(CTV1)에서 제2 카운트 값(CTV2)을 감산한 제3 카운트 값(CTV3)을 생성할 수 있다. The subtractor 134 may receive the first count value CTV1 from the tied map module 132 . The subtractor 134 may receive the second count value CTV2 from the end map module 133 . The subtractor 134 may generate a third count value CTV3 by subtracting the second count value CTV2 from the first count value CTV1.

카운터 회로(135)는 비긴 맵 모듈(132)로부터 제1 카운트 값(CTV1)을 수신할 수 있다. 카운터 회로(135)는 감산기(134)로부터 제3 카운트 값(CTV3)을 수신할 수 있다. 카운터 회로(135)는 가산기 및 비트 카운터를 포함할 수 있다. 가산기는 제1 카운트 값(CTV1)에서 제3 카운트 값(CTV3)을 가산하여 비트맵을 복원할 수 있다. 비트 카운터는 복원된 비트맵에서 제1 값(예를 들어 '1')을 갖는 비트의 개수를 카운트하여 비트 카운트 값을 생성할 수 있다. 카운터 회로(135)는 비트 카운트 값을 포함하는 제2 리턴 신호(RET2)를 리턴 큐(113)를 통해 호스트로 출력할 수 있다. The counter circuit 135 may receive the first count value CTV1 from the tied map module 132 . The counter circuit 135 may receive the third count value CTV3 from the subtractor 134 . The counter circuit 135 may include an adder and a bit counter. The adder may restore the bitmap by adding the third count value CTV3 to the first count value CTV1. The bit counter may generate a bit count value by counting the number of bits having a first value (eg '1') in the restored bitmap. The counter circuit 135 may output the second return signal RET2 including the bit count value to the host through the return queue 113 .

도 6b는 도 6a의 비트 카운트 값을 계산하는 방법을 예시적으로 설명하는 도면이다. 도 6b를 참조하면, 비트맵, 비긴 맵, 엔드 맵, 제1 카운트 값(CTV1), 제3 카운트 값(CTV3), 가산된 값, 및 비트 카운트 값이 순차적으로 도시된다.FIG. 6B is a diagram illustrating a method of calculating the bit count value of FIG. 6A by way of example. Referring to FIG. 6B , a bitmap, a drawn map, an end map, a first count value (CTV1), a third count value (CTV3), an added value, and a bit count value are sequentially shown.

비트맵은 메모리 공간에서 살아있는 객체들이 할당된 서브 메모리 공간을 제1 값(예를 들어, '1)으로 표시하고, 죽은 객체들이 할당된 서브 메모리 공간 또는 객체가 할당되지 않은 서브 메모리 공간을 제2 값(예를 들어, '0')으로 표시한 것일 수 있다. 비긴 맵은 비트맵에서 살아있는 객체가 시작되는 위치 정보를 포함할 수 있다. 제1 카운트 값(CTV1)은 비긴 맵을 숫자 타입으로 표현한 값일 수 있다. 엔드 맵은 비트맵에서 살아있는 객체가 끝나는 위치 정보를 포함할 수 있다. 제2 카운트 값(CTV2)은 엔드 맵을 숫자 타입으로 표현한 값일 수 있다. 제3 카운트 값(CTV3)은 제1 카운트 값(CTV1)에서 제2 카운트 값(CTV2)을 감산하여 획득되는 숫자 타입으로 표현된 값일 수 있다. The bitmap displays a sub-memory space to which live objects are allocated as a first value (eg '1), and a sub-memory space to which dead objects are allocated or a sub-memory space to which no objects are allocated as a second value. It may be expressed as a value (for example, '0'). The drawn map may include information on a starting location of a living object in the bitmap. The first count value CTV1 may be a value expressing a drawn map in a number type. The end map may include information on the location where the living object ends in the bitmap. The second count value CTV2 may be a value expressing an end map as a number type. The third count value CTV3 may be a value represented by a number type obtained by subtracting the second count value CTV2 from the first count value CTV1.

가산된 값은 도 6a의 카운터 회로(135)의 가산기가 제1 카운트 값(CTV1)에서 제3 카운트 값(CTV3)을 가산한 값일 수 있다. 가산된 값은 실질적으로 비트맵과 동일한 정보를 포함할 수 있다. 비트 카운트 값은 가산된 값을 일련의 비트들로 표현할 때, 제1 값(예를 들어, '1')을 갖는 비트들의 개수를 카운트한 값일 수 있다. 예를 들어, 비트맵이 도 6b에서 도시된 비트맵인 경우, 비트 카운트 값은 '9'일 수 있다. 상술된 바와 같이, 비트 카운트 값은 비트맵에 대응하는 메모리 공간 내에서 살아있는 객체의 크기 정보를 포함할 수 있다. The added value may be a value obtained by adding the third count value CTV3 from the first count value CTV1 by the adder of the counter circuit 135 of FIG. 6A. The added value may include substantially the same information as the bitmap. The bit count value may be a value obtained by counting the number of bits having a first value (eg, '1') when the added value is expressed as a series of bits. For example, when the bitmap is the bitmap shown in FIG. 6B, the bit count value may be '9'. As described above, the bit count value may include size information of an object living in a memory space corresponding to a bitmap.

도 7은 도 3의 스캔 푸시 유닛(140)을 예시적으로 구체화한 블록도이다. 도 7을 참조하면, 스캔 푸시 유닛(140)은 제3 요청 생성기(141), 타입 판별기(142), 객체 마커(143), 푸시 스택 모듈(144), 및 메타데이터 업데이터(145)를 포함할 수 있다. FIG. 7 is a block diagram exemplarily embodying the scan push unit 140 of FIG. 3 . Referring to FIG. 7 , the scan push unit 140 includes a third request generator 141, a type determiner 142, an object marker 143, a push stack module 144, and a metadata updater 145. can do.

제3 요청 생성기(141)는 호스트로부터 제3 커맨드 큐(112c)를 통해 제3 커맨드(CMD3)를 수신할 수 있다. 제3 요청 생성기(141)는 제3 커맨드(CMD3)를 기반으로 제3 요청 신호(RQ3)를 메모리 인터페이스 회로(150)로 출력할 수 있다. 메모리 인터페이스 회로(150)는 제3 요청 신호(RQ3)를 메모리 장치로 전송할 수 있다. 메모리 장치는 제3 요청 신호(RQ3)에 응답하여 제3 응답 신호(RP3)를 메모리 인터페이스 회로(150)로 출력할 수 있다.The third request generator 141 may receive the third command CMD3 from the host through the third command queue 112c. The third request generator 141 may output the third request signal RQ3 to the memory interface circuit 150 based on the third command CMD3. The memory interface circuit 150 may transmit the third request signal RQ3 to the memory device. The memory device may output the third response signal RP3 to the memory interface circuit 150 in response to the third request signal RQ3.

예시적인 실시 예에서, 메모리 인터페이스 회로(150)는 비트맵을 포함하는 전기적인 신호를 출력할 수 있다. 메모리 인터페이스 회로(150)는 메모리 장치의 객체를 마크하기 위한 전기적인 신호를 출력할 수 있다. In an exemplary embodiment, the memory interface circuit 150 may output an electrical signal including a bitmap. The memory interface circuit 150 may output an electrical signal for marking an object of a memory device.

타입 판별기(142)는 메모리 장치로부터 메모리 인터페이스 회로(150)를 통해 제3 응답 신호(RP3)를 수신할 수 있다. 타입 판별기(142)는 제3 응답 신호(RP3)를 기반으로, 제1 내지 제3 케이스들을 판별할 수 있다. The type determiner 142 may receive the third response signal RP3 from the memory device through the memory interface circuit 150 . The type determiner 142 may determine the first to third cases based on the third response signal RP3.

제1 케이스는 객체가 마크된 케이스일 수 있다. 객체가 마크된 것은 해당 객체가 다른 객체에 의해 참조되는(즉, 해당 객체가 살아있는) 것으로 표시된 것을 의미할 수 있다. 제2 케이스는 객체가 마크되지 않고 마이너 가비지 컬렉션을 수행하는 케이스일 수 있다. 예를 들어, 제2 케이스에서 객체가 영 제너레이션에 포함될 수 있다. 제3 케이스는 객체가 마크되지 않고 메이저 가비지 컬렉션을 수행하는 케이스일 수 있다. 예를 들어, 제3 케이스에서 객체가 올드 제너레이션에 포함될 수 있다. The first case may be a case in which an object is marked. When an object is marked, it may mean that the corresponding object is marked as being referenced by another object (ie, the corresponding object is alive). The second case may be a case in which the object is not marked and minor garbage collection is performed. For example, in the second case, the object may be included in the zero generation. A third case may be a case in which an object is not marked and major garbage collection is performed. For example, in the third case, the object may be included in the old generation.

메타데이터 업데이터(145)는, 타입 판별기(142)가 제3 응답 신호(RP3)에 대응하는 객체를 제1 케이스에 해당하는 것으로 판별하면, 객체의 메타데이터를 갱신할 수 있다. 예시적인 실시 예에서, 메타데이터 업데이터(145)는 갱신된 메타데이터의 저장을 요청하는 신호를 메모리 인터페이스 회로(150)로 출력할 수 있다. 이 후, 메모리 장치는 갱신된 메타데이터를 저장할 수 있다.The metadata updater 145 may update metadata of the object when the type discriminator 142 determines that the object corresponding to the third response signal RP3 corresponds to the first case. In an exemplary embodiment, the metadata updater 145 may output a signal requesting storage of updated metadata to the memory interface circuit 150 . After that, the memory device may store the updated metadata.

푸시 스택 모듈(144)은, 타입 판별기(142)가 제3 응답 신호(RP3)에 대응하는 객체를 제2 케이스에 해당하거나 또는 제3 케이스에 해당하는 것으로 판별하면, 해당 객체를 스택 메모리에 푸시할 수 있다. 예시적인 실시 예에서, 푸시 스택 모듈(144)은 객체의 푸시를 요청하는 신호를 메모리 인터페이스 회로(150)로 출력할 수 있다. 이 후, 메모리 장치의 스택 메모리에 해당 객체가 푸시될 수 있다.When the type discriminator 142 determines that the object corresponding to the third response signal RP3 corresponds to the second case or the third case, the push stack module 144 stores the corresponding object in the stack memory. can push In an exemplary embodiment, the push stack module 144 may output a signal requesting object push to the memory interface circuit 150 . After that, the corresponding object may be pushed to the stack memory of the memory device.

객체 마커(143)는, 타입 판별기(142)가 제3 응답 신호(RP3)에 대응하는 객체를 제3 케이스에 해당하는 것으로 판별하면, 해당 객체를 마크할 수 있다. 예를 들어, 객체 마커(143)는 메모리 인터페이스 회로(150)로부터 비트맵을 수신할 수 있고, 해당 객체의 필드를 마크하도록 제어하는 신호를 메모리 인터페이스 회로(150)로 출력할 수 있다. 이 후, 객체 마커(143)는 제3 케이스에 해당하는 객체를 스택 메모리에 푸시하기 위해, 푸시 스택 모듈(144)을 활성화시킬 수 있다. 이에 따라, 푸시 스택 모듈(144)은 해당 객체를 스택 메모리에 푸시할 수 있다. The object marker 143 may mark the object when the type discriminator 142 determines that the object corresponding to the third response signal RP3 corresponds to the third case. For example, the object marker 143 may receive a bitmap from the memory interface circuit 150 and output a control signal to mark a field of a corresponding object to the memory interface circuit 150 . Then, the object marker 143 may activate the push stack module 144 to push the object corresponding to the third case to the stack memory. Accordingly, the push stack module 144 may push the object to the stack memory.

예시적인 실시 예에서, 스캔 푸시 유닛(140)은 메모리 공간에서의 모든 살아있는 객체가 마크될 때까지, 순차적으로 그리고 반복적으로 스캔 동작 및 푸시 동작을 수행할 수 있다. In an exemplary embodiment, the scan and push unit 140 may sequentially and repeatedly perform scan and push operations until all live objects in the memory space are marked.

상술된 바와 같이, 본 발명의 실시 예에 따르면, 스캔 푸시 유닛(140)은 제1 내지 제3 케이스들에 따라 다르게 동작할 수 있다. 보다 상세하게는, 제1 케이스에서, 스캔 푸시 유닛(140)은 마크된 객체의 메타데이터를 업데이트할 수 있다. 제2 케이스에서, 스캔 푸시 유닛(140)은 마이너 가비지 컬렉션에서의 마크되지 않은 객체를 스택 메모리에 푸시할 수 있다. 그리고, 제3 케이스에서, 스캔 푸시 유닛(140)은 메이저 가비지 컬렉션에서의 마크되지 않은 객체를 마크한 후, 새로 마크된 객체를 스택 메모리에 푸시할 수 있다. As described above, according to an embodiment of the present invention, the scan push unit 140 may operate differently according to the first to third cases. More specifically, in the first case, the scan push unit 140 may update metadata of the marked object. In the second case, the scan push unit 140 may push an unmarked object in the minor garbage collection to the stack memory. And, in the third case, the scan push unit 140 may mark an unmarked object in major garbage collection and then push a newly marked object to the stack memory.

도 8은 도 3의 메모리 인터페이스 회로(150)를 예시적으로 구체화한 블록도이다. 도 8을 참조하면, 메모리 인터페이스 회로(150)는 메모리 액세스 인터페이스(151) 및 변환 색인 버퍼(TLB; Translation Lookaside Buffer)(152)를 포함할 수 있다. 메모리 액세스 인터페이스(151)는 메타데이터 캐시(151a) 및 비트맵 캐시(151b)를 포함할 수 있다.FIG. 8 is a block diagram exemplarily embodying the memory interface circuit 150 of FIG. 3 . Referring to FIG. 8 , the memory interface circuit 150 may include a memory access interface 151 and a translation lookaside buffer (TLB) 152 . The memory access interface 151 may include a metadata cache 151a and a bitmap cache 151b.

메타데이터 캐시(151a)는 카피 서치 유닛(120), 비트맵 카운트 유닛(130), 및 스캔 푸시 유닛(140) 중 적어도 하나와 연결될 수 있다. 메타데이터 캐시(151a)는 객체의 메타데이터를 저장할 수 있다. 예시적인 실시 예에서, 메타데이터 캐시(151a)는 유닛 ID(Identification) 및 해당 유닛 ID에서 요청된 메타데이터를 하나의 세트로서 저장할 수 있다. 유닛 ID는 카피 서치 유닛(120), 비트맵 카운트 유닛(130), 및 스캔 푸시 유닛(140)를 구별하기 위한 코드일 수 있다. 예를 들어, ID1은 카피 서치 유닛(120)을 지칭할 수 있고, ID2는 비트맵 카운트 유닛(130)을 지칭할 수 있고, ID3는 스캔 푸시 유닛(140)을 지칭할 수 있다. The metadata cache 151a may be connected to at least one of the copy search unit 120 , the bitmap count unit 130 , and the scan push unit 140 . The metadata cache 151a may store object metadata. In an exemplary embodiment, the metadata cache 151a may store a unit ID (Identification) and metadata requested by the corresponding unit ID as one set. The unit ID may be a code for distinguishing the copy search unit 120 , the bitmap count unit 130 , and the scan push unit 140 . For example, ID1 may refer to the copy search unit 120 , ID2 may refer to the bitmap count unit 130 , and ID3 may refer to the scan push unit 140 .

비트맵 캐시(151b)는 비트맵 카운트 유닛(130) 및 스캔 푸시 유닛(140) 중 적어도 하나와 연결될 수 있다. 비트맵 캐시(151b)는 객체를 포함하는 메모리 공간에 대응하는 비트맵을 저장할 수 있다. 메모리 장치의 메모리 공간에 직접 액세스하는 대신, 비트맵을 저장하는 비트맵 캐시(151b)를 별도로 구비함으로써, 비트맵 카운트 동작시 비트맵을 빠르게 참조할 수 있다. 또한, 스캔 푸시 유닛(140)의 객체 마커(143)가 살아있는 객체를 마크할 때, 비트맵을 보다 빠르게 참조할 수 있다. The bitmap cache 151b may be connected to at least one of the bitmap count unit 130 and the scan push unit 140 . The bitmap cache 151b may store a bitmap corresponding to a memory space including an object. Instead of directly accessing the memory space of the memory device, the bitmap may be quickly referred to during a bitmap count operation by separately providing the bitmap cache 151b for storing the bitmap. Also, when the object marker 143 of the scan push unit 140 marks a living object, the bitmap can be referred to more quickly.

변환 색인 버퍼(152)는 메모리 액세스 인터페이스(151) 및 메모리 장치와 연결될 수 있다. 변환 색인 버퍼(152)는 가상 메모리 주소 및 물리적인 주소 사이의 변환을 가속하는데 사용되는 캐시 메모리일 수 있다. The conversion lookaside buffer 152 may be connected to the memory access interface 151 and the memory device. Translation lookaside buffer 152 may be a cache memory used to accelerate translations between virtual memory addresses and physical addresses.

도 9는 본 발명의 실시 예에 따른 3차원 구조를 갖는 메모리 시스템(10)을 예시적으로 보여주는 도면이다. 도 9를 참조하면, 메모리 시스템(10)은 호스트(11), 로직 레이어, 및 적어도 하나의 하이브리드 메모리 큐브(HMC; Hybrid Memory Cube)를 포함할 수 있다. 예시적인 실시 예에서, 메모리 시스템(10)은 3차원 적층 기법으로 구현될 수 있다. 9 is a diagram showing a memory system 10 having a 3D structure according to an exemplary embodiment of the present invention. Referring to FIG. 9 , the memory system 10 may include a host 11, a logic layer, and at least one hybrid memory cube (HMC). In an exemplary embodiment, the memory system 10 may be implemented using a 3D stacking technique.

본 발명의 이해를 돕기 위해, 메모리 시스템(10)은 제1 내지 제4 하이브리드 메모리 큐브들(HMC1~HMC4)을 포함하는 것으로 도시되나, 본 발명의 범위는 이에 제한되지 않으며, 메모리 시스템(10)에 포함된 하이브리드 메모리 큐브들의 수는 증가 또는 감소될 수 있다. 호스트(11)는 도 1의 호스트(11)와 유사하므로, 이에 대한 상세한 설명은 생략된다. For better understanding of the present invention, the memory system 10 is illustrated as including first to fourth hybrid memory cubes HMC1 to HMC4, but the scope of the present invention is not limited thereto, and the memory system 10 The number of hybrid memory cubes included in can be increased or decreased. Since the host 11 is similar to the host 11 of FIG. 1, a detailed description thereof is omitted.

도 9에서, 제1 내지 제3 방향들(D1~D3)이 정의된다. 제1 방향(D1)은 호스트(11) 및 로직 레이어를 연결하는 방향일 수 있다. 제2 방향(D2)은 제1 방향(D1)에 수직한 방향일 수 있다. 제3 방향(D3)은 제1 방향(D1) 및 제2 방향(D2)으로 정의된 평면에 수직한 방향일 수 있다. 예를 들어, 제1 방향(D1) 및 제2 방향(D2)으로 정의된 평면은 반도체 기판과 평행할 수 있다. 제3 방향(D3)은 DRAM 레이어들이 적층되는 방향일 수 있다. In FIG. 9 , first to third directions D1 to D3 are defined. The first direction D1 may be a direction connecting the host 11 and the logic layer. The second direction D2 may be perpendicular to the first direction D1. The third direction D3 may be a direction perpendicular to a plane defined by the first and second directions D1 and D2. For example, a plane defined by the first direction D1 and the second direction D2 may be parallel to the semiconductor substrate. The third direction D3 may be a direction in which DRAM layers are stacked.

로직 레이어는 호스트(11)로부터 제1 방향으로 이격되어 위치할 수 있다. 로직 레이어는 호스트(11)와 전기적으로 연결될 수 있다. 로직 레이어는 메모리 컨트롤러가 형성되는 레이어일 수 있다. 예를 들어, 로직 레이어에 도 1의 메모리 컨트롤러(12)가 형성될 수 있다. The logic layer may be spaced apart from the host 11 in a first direction. The logic layer may be electrically connected to the host 11 . The logic layer may be a layer in which a memory controller is formed. For example, the memory controller 12 of FIG. 1 may be formed on a logic layer.

예시적인 실시 예에서, 가비지 컬렉션 장치(100)는 로직 레이어 상에 형성될 수 있다. 가비지 컬렉션 장치(100)가 로직 레이어에 위치함으로써, 소프트웨어적으로 가비지 컬렉션을 수행하는 일반적인 기법에 비해, 내부 메모리 대역폭을 사용할 수 있다는 이점 및 메모리 액세스의 지연 시간이 감소되는 이점을 가질 수 있다. In an exemplary embodiment, the garbage collection device 100 may be formed on a logic layer. Since the garbage collection device 100 is located in the logic layer, compared to a general technique of performing garbage collection in software, internal memory bandwidth can be used and delay time of memory access can be reduced.

제1 하이브리드 메모리 큐브(HMC1)는 로직 레이어 상에 제3 방향으로 적층될 수 있다. 제1 하이브리드 메모리 큐브(HMC1)는 로직 레이어와 전기적으로 연결될 수 있다. 제1 하이브리드 메모리 큐브(HMC1)는 제3 방향으로 적층된 N개의 DRAM 레이어들을 포함할 수 있다. 이 때, N은 임의의 자연수이다. N개의 DRAM 레이어들 각각은 데이터를 저장하는 메모리 셀을 포함할 수 있다. The first hybrid memory cube HMC1 may be stacked on the logic layer in the third direction. The first hybrid memory cube HMC1 may be electrically connected to the logic layer. The first hybrid memory cube HMC1 may include N DRAM layers stacked in the third direction. In this case, N is any natural number. Each of the N DRAM layers may include a memory cell storing data.

제2 하이브리드 메모리 큐브(HMC2)는 로직 레이어로부터 제2 방향의 반대 방향으로 이격되어 위치할 수 있다. 제2 하이브리드 메모리 큐브(HMC2)는 로직 레이어와 전기적으로 연결될 수 있다. 도면의 복잡함을 피하기 위해 도 9에서 도시되지 않았으나, 제2 하이브리드 메모리 큐브(HMC2)는 제1 하이브리드 메모리 큐브(HMC1)와 마찬가지로 복수의 DRAM 레이어들을 포함할 수 있다. The second hybrid memory cube HMC2 may be spaced apart from the logic layer in a direction opposite to the second direction. The second hybrid memory cube HMC2 may be electrically connected to the logic layer. Although not shown in FIG. 9 to avoid drawing complexity, the second hybrid memory cube HMC2 may include a plurality of DRAM layers similarly to the first hybrid memory cube HMC1.

제3 하이브리드 메모리 큐브(HMC3)는 로직 레이어로부터 제1 방향으로 이격되어 위치할 수 있다. 제3 하이브리드 메모리 큐브(HMC3)는 로직 레이어와 전기적으로 연결될 수 있다. 도면의 복잡함을 피하기 위해 도 9에서 도시되지 않았으나, 제3 하이브리드 메모리 큐브(HMC3)는 제1 하이브리드 메모리 큐브(HMC1)와 마찬가지로 복수의 DRAM 레이어들을 포함할 수 있다. The third hybrid memory cube HMC3 may be spaced apart from the logic layer in the first direction. The third hybrid memory cube HMC3 may be electrically connected to the logic layer. Although not shown in FIG. 9 to avoid drawing complexity, the third hybrid memory cube HMC3 may include a plurality of DRAM layers like the first hybrid memory cube HMC1.

제4 하이브리드 메모리 큐브(HMC4)는 로직 레이어로부터 제2 방향으로 이격되어 위치할 수 있다. 제4 하이브리드 메모리 큐브(HMC4)는 로직 레이어와 전기적으로 연결될 수 있다. 도면의 복잡함을 피하기 위해 도 9에서 도시되지 않았으나, 제4 하이브리드 메모리 큐브(HMC4)는 제1 하이브리드 메모리 큐브(HMC1)와 마찬가지로 복수의 DRAM 레이어들을 포함할 수 있다. The fourth hybrid memory cube HMC4 may be spaced apart from the logic layer in the second direction. The fourth hybrid memory cube HMC4 may be electrically connected to the logic layer. Although not shown in FIG. 9 to avoid drawing complexity, the fourth hybrid memory cube HMC4 may include a plurality of DRAM layers like the first hybrid memory cube HMC1.

예시적인 실시 예에서, 제1 내지 제4 하이브리드 메모리 큐브들(HMC1~HMC4)은 도 1의 메모리 장치(13)에 포함될 수 있다. 제1 내지 제4 하이브리드 메모리 큐브들(HMC1~HMC4) 각각은 데이터를 저장하는 장치일 수 있다. In an exemplary embodiment, the first to fourth hybrid memory cubes HMC1 to HMC4 may be included in the memory device 13 of FIG. 1 . Each of the first to fourth hybrid memory cubes HMC1 to HMC4 may be a device for storing data.

도 10은 본 발명의 실시 예에 따른 마이너 가비지 컬렉션을 수행하는 방법을 예시적으로 구체화한 순서도이다. 도 10을 참조하면, 마이너 가비지 컬렉션을 수행하는 방법이 예시적으로 도시된다. 마이너 가비지 컬렉션은 도 3의 가비지 컬렉션 장치(100)에 의해 수행될 수 있다.10 is a flowchart illustrating a method of performing minor garbage collection according to an exemplary embodiment of the present invention. Referring to FIG. 10 , a method of performing minor garbage collection is illustrated as an example. Minor garbage collection may be performed by the garbage collection apparatus 100 of FIG. 3 .

S110 단계에서, 가비지 컬렉션 장치는 스택 메모리로부터 객체를 팝(pop)할 수 있다. S120 단계에서, 가비지 컬렉션 장치는 객체가 마크되었는지 판별할 수 있다. 예를 들어, 가비지 컬렉션 장치는 S110 단계에서 팝된 객체의 필드가 마크되었는지 판별할 수 있다. 마크된 것으로 판별되면, S110 단계를 다시 수행할 수 있다. 마크되지 않은 것으로 판별되면, S130 단계로 이동할 수 있다.In step S110, the garbage collection device may pop an object from the stack memory. In step S120, the garbage collection device may determine whether the object is marked. For example, the garbage collection device may determine whether a field of the popped object is marked in step S110. If it is determined that it is marked, step S110 may be performed again. If it is determined that it is not marked, it may move to step S130.

S130 단계에서, 가비지 컬렉션 장치는 객체를 살아있는 것으로 마크할 수 있고, 이 후 객체를 카피하거나 또는 객체를 프로모트 시킬 수 있다. 객체가 살아있다는 것은 객체가 다른 객체에 의해 참조되는 것을 의미할 수 있다. 객체를 카피할지 또는 객체를 프로모트 시킬지 여부는 해당 객체가 겪은 가비지 컬렉션의 횟수가 기준 횟수를 초과하는지에 따라 결정될 수 있다. In step S130, the garbage collection device may mark the object as alive, and then copy the object or promote the object. When an object is alive, it can mean that the object is referenced by another object. Whether to copy the object or promote the object may be determined according to whether the number of garbage collections that the corresponding object has undergone exceeds the reference number.

즉, 객체가 오랜 기간 동안 살아있으면 올드 제너레이션으로 이동시키기 위해 프로모트될 수 있고, 객체가 충분히 오랜 기간 동안 살아있지 않다면, 영 제너레이션 내에서 서바이벌-프롬 공간으로부터 서바이벌-투 공간으로 카피될 수 있다.That is, if an object has lived for a long time, it can be promoted to be moved to the old generation, and if an object has not lived long enough, it can be copied from the survival-from space to the survival-to-two space within the young generation.

S140 단계에서, 가비지 컬렉션 장치는 객체가 다른 객체에 의해 참조되는지를 판별할 수 있고, 참조된 객체를 스택 메모리에 푸시할 수 있다. 예시적인 실시 예에서, S110 내지 S140 단계들은 스택 메모리의 모든 객체들을 처리할 때까지 반복될 수 있다.In step S140, the garbage collection device may determine whether the object is referenced by another object, and may push the referenced object to the stack memory. In an exemplary embodiment, steps S110 to S140 may be repeated until all objects in the stack memory have been processed.

도 11은 본 발명의 실시 예에 따른 메이저 가비지 컬렉션을 수행하는 방법을 예시적으로 구체화한 순서도이다. 도 11을 참조하면, 메이저 가비지 컬렉션을 수행하는 방법이 예시적으로 도시된다. 메이저 가비지 컬렉션은 도 3의 가비지 컬렉션 장치(100)에 의해 수행될 수 있다. S210 단계, S220 단계, 및 S240 단계는 도 10의 S110 단계, S120 단계, 및 S140 단계와 유사하므로, 이에 대한 상세한 설명은 생략된다.11 is a flowchart illustrating a method of performing major garbage collection according to an exemplary embodiment of the present invention. Referring to FIG. 11 , a method of performing major garbage collection is illustrated as an example. Major garbage collection may be performed by the garbage collection apparatus 100 of FIG. 3 . Since steps S210, S220, and S240 are similar to steps S110, S120, and S140 of FIG. 10, detailed descriptions thereof are omitted.

S230 단계에서, 가비지 컬렉션 장치는 객체를 살아있는 것으로 마크할 수 있다. S230 단계는 S220 단계에서 객체가 마크되지 않은 것으로 판별될 때 수행될 수 있다. 도 10의 S130 단계와 달리, S230 단계에서 객체를 카피하거나 객체를 프로모트 시키는 동작은 생략될 수 있다. In step S230, the garbage collection device may mark the object as alive. Step S230 may be performed when it is determined in step S220 that the object is not marked. Unlike step S130 of FIG. 10 , an operation of copying an object or promoting an object may be omitted in step S230 .

S250 단계에서, 가비지 컬렉션 장치는 올드 제너레이션에서 살아있는 객체를 컴팩션시킬 수 있다. 컴팩션은 메모리 공간에서 살아있는 객체들을 순차적이고 연속적으로 재할당하는 것일 수 있다. 메모리 공간을 재할당하기 위해 살아있는 객체들의 크기 정보가 필요할 수 있다. 가비지 컬렉션 장치는 비트맵 카운트 동작을 통해 획득된 비트 카운트 값을 기반으로 컴팩션 동작을 수행할 수 있다.In step S250, the garbage collection device may compact living objects in the old generation. Compaction can be the sequential and contiguous reallocation of living objects in memory space. Size information of live objects may be needed to reallocate memory space. The garbage collection device may perform a compaction operation based on a bit count value obtained through a bitmap count operation.

상술된 내용은 본 발명을 실시하기 위한 구체적인 실시 예들이다. 본 발명은 상술된 실시 예들뿐만 아니라, 단순하게 설계 변경되거나 용이하게 변경할 수 있는 실시 예들 또한 포함할 것이다. 또한, 본 발명은 실시 예들을 이용하여 용이하게 변형하여 실시할 수 있는 기술들도 포함될 것이다. 따라서, 본 발명의 범위는 상술된 실시 예들에 국한되어 정해져서는 안되며 후술하는 특허청구범위뿐만 아니라 이 발명의 특허청구범위와 균등한 것들에 의해 정해져야 할 것이다.The foregoing are specific embodiments for carrying out the present invention. The present invention will include not only the above-described embodiments, but also embodiments that can be simply or easily changed in design. In addition, the present invention will also include techniques that can be easily modified and practiced using the embodiments. Therefore, the scope of the present invention should not be limited to the above-described embodiments and should not be defined by the following claims as well as those equivalent to the claims of this invention.

10: 메모리 시스템
11: 호스트
12: 메모리 컨트롤러
13: 메모리 장치
100: 가비지 컬렉션 장치
110: 호스트 인터페이스 회로
120: 카피 서치 유닛
130: 비트맵 카운트 유닛
140: 스캔 푸시 유닛
150: 메모리 인터페이스 회로
10: memory system
11: host
12: memory controller
13: memory device
100: garbage collection device
110 host interface circuit
120: copy search unit
130: bitmap count unit
140: scan push unit
150: memory interface circuit

Claims (10)

메모리 장치로부터 수신된 제1 응답 신호를 기반으로, 제1 객체를 카피하거나, 또는 상기 제1 객체가 제2 객체에 의해 참조되는지 여부를 가리키는 서치 값을 호스트로 출력하도록 구성된 카피 서치 유닛;
상기 제1 객체가 상기 제2 객체에 의해 참조된다고 판별되면, 상기 메모리 장치로부터 수신된 제2 응답 신호를 기반으로, 상기 제1 객체의 크기 정보를 포함하는 비트 카운트 값을 상기 호스트로 출력하도록 구성된 비트맵 카운트 유닛; 및
상기 메모리 장치로부터 수신된 제3 응답 신호를 기반으로, 상기 제1 객체의 메타데이터를 갱신하거나, 또는 상기 제1 객체를 스택 메모리에 푸시하도록 구성된 스캔 푸시 유닛을 포함하는 가비지 컬렉션 장치.
a copy search unit configured to copy a first object or output a search value indicating whether the first object is referenced by a second object to a host based on a first response signal received from the memory device;
If it is determined that the first object is referenced by the second object, output a bit count value including size information of the first object to the host based on a second response signal received from the memory device bitmap count unit; and
and a scan push unit configured to update metadata of the first object or push the first object to a stack memory based on a third response signal received from the memory device.
제 1 항에 있어서,
상기 메모리 장치는 제1 요청 신호에 응답하여 상기 제1 응답 신호를 생성하도록 구성되고,
상기 카피 서치 유닛은:
상기 호스트로부터 제1 커맨드를 수신하고, 상기 제1 커맨드를 기반으로 상기 제1 요청 신호를 상기 메모리 장치로 출력하도록 구성된 제1 요청 생성기;
상기 제1 응답 신호를 기반으로, 카피 정보 신호 또는 서치 정보 신호를 생성하도록 구성된 카피 서치 모듈;
상기 카피 정보 신호를 기반으로, 상기 카피된 제1 객체에 대응하는 어드레스를 상기 메모리 장치로 출력하도록 구성된 어드레스 계산기; 및
상기 제1 객체가 상기 제2 객체에 의해 참조되는지를 판별하고, 상기 서치 값을 포함하는 제1 리턴 신호를 상기 호스트로 출력하도록 구성된 객체 판별기를 포함하는 가비지 컬렉션 장치.
According to claim 1,
The memory device is configured to generate the first response signal in response to a first request signal;
The copy search unit:
a first request generator configured to receive a first command from the host and output the first request signal to the memory device based on the first command;
a copy search module configured to generate a copy information signal or a search information signal based on the first response signal;
an address calculator configured to output an address corresponding to the copied first object to the memory device based on the copy information signal; and
and an object discriminator configured to determine whether the first object is referenced by the second object and output a first return signal including the search value to the host.
제 1 항에 있어서,
상기 메모리 장치는 제2 요청 신호에 응답하여 상기 제2 응답 신호를 생성하도록 구성되고,
상기 제1 객체가 상기 제2 객체에 의해 참조된다고 판별되면, 상기 비트맵 카운트 유닛은:
상기 호스트로부터 제2 커맨드를 수신하고, 상기 제2 커맨드를 기반으로 상기 제2 요청 신호를 상기 메모리 장치로 출력하도록 구성된 제2 요청 생성기;
상기 제2 응답 신호를 기반으로 상기 메모리 장치에서 상기 제1 객체가 시작되는 위치를 포함하는 비긴 맵(begin map)에 대응하는 제1 카운트 값을 생성하도록 구성된 비긴 맵 모듈;
상기 제2 응답 신호를 기반으로 상기 메모리 장치에서 상기 제1 객체가 끝나는 위치를 포함하는 엔드 맵(end map)에 대응하는 제2 카운트 값을 생성하도록 구성된 엔드 맵 모듈;
상기 제1 카운트 값에서 상기 제2 카운트 값을 감산한 제3 카운트 값을 생성하도록 구성된 감산기; 및
상기 제1 카운트 값에서 상기 제3 카운트 값을 가산하여 상기 제1 객체의 비트맵을 복원하고, 상기 비트맵에서 특정 값을 갖는 비트의 개수를 카운트하여 상기 비트 카운트 값을 생성하고, 상기 비트 카운트 값을 포함하는 제2 리턴 신호를 상기 호스트로 출력하도록 구성된 카운터 회로를 포함하는 가비지 컬렉션 장치.
According to claim 1,
the memory device is configured to generate the second response signal in response to a second request signal;
If it is determined that the first object is referenced by the second object, the bitmap count unit:
a second request generator configured to receive a second command from the host and output the second request signal to the memory device based on the second command;
a begin map module configured to generate a first count value corresponding to a begin map including a starting position of the first object in the memory device based on the second response signal;
an end map module configured to generate a second count value corresponding to an end map including an end position of the first object in the memory device based on the second response signal;
a subtractor configured to generate a third count value by subtracting the second count value from the first count value; and
Restoring the bitmap of the first object by adding the third count value to the first count value, counting the number of bits having a specific value in the bitmap to generate the bit count value, and generating the bit count value and a counter circuit configured to output a second return signal including a value to the host.
제 1 항에 있어서,
상기 메모리 장치는 제3 요청 신호에 응답하여 상기 제3 응답 신호를 생성하도록 구성되고,
상기 스캔 푸시 유닛은:
상기 호스트로부터 제3 커맨드를 수신하고, 상기 제3 커맨드를 기반으로 상기 제3 요청 신호를 상기 메모리 장치로 출력하도록 구성된 제3 요청 생성기;
상기 제3 응답 신호를 기반으로, 상기 제1 객체가 마크된 제1 케이스, 상기 제1 객체가 마크되지 않고 상기 제1 객체가 영 제너레이션(young generation)에 포함된 제2 케이스, 및 상기 제1 객체가 마크되지 않고 상기 제1 객체가 올드 제너레이션(old generation)에 포함된 제3 케이스 중 하나를 판별하도록 구성된 타입 판별기;
상기 제1 케이스로 판별되면, 상기 제1 객체의 상기 메타데이터를 갱신하도록 구성된 메타데이터 업데이터;
상기 제2 케이스 또는 상기 제3 케이스로 판별되면, 상기 제1 객체를 상기 스택 메모리에 푸시하도록 구성된 푸시 스택 모듈; 및
상기 제3 케이스로 판별되면 상기 제1 객체를 마크하도록 구성된 객체 마커를 포함하는 가비지 컬렉션 장치.
According to claim 1,
The memory device is configured to generate the third response signal in response to a third request signal;
The scan push unit:
a third request generator configured to receive a third command from the host and output the third request signal to the memory device based on the third command;
Based on the third response signal, a first case in which the first object is marked, a second case in which the first object is not marked and the first object is included in a young generation, and the first a type determiner configured to determine one of third cases in which the object is not marked and the first object is included in an old generation;
a metadata updater configured to update the metadata of the first object when the first case is determined;
a push stack module configured to push the first object to the stack memory when the second case or the third case is determined; and
and an object marker configured to mark the first object when it is determined as the third case.
제 1 항에 있어서,
상기 호스트, 상기 카피 서치 유닛, 상기 비트맵 카운트 유닛, 및 상기 스캔 푸시 유닛과 연결된 호스트 인터페이스 회로; 및
상기 메모리 장치, 상기 카피 서치 유닛, 상기 비트맵 카운트 유닛, 및 상기 스캔 푸시 유닛과 연결된 메모리 인터페이스 회로를 더 포함하는 가비지 컬렉션 장치.
According to claim 1,
a host interface circuit connected to the host, the copy search unit, the bitmap count unit, and the scan push unit; and
The garbage collection device further includes a memory interface circuit connected to the memory device, the copy search unit, the bitmap count unit, and the scan push unit.
제 5 항에 있어서,
상기 호스트 인터페이스 회로는:
상기 호스트로부터 제1 내지 제3 커맨드 중 적어도 하나를 수신하도록 구성된 메인 커맨드 큐;
상기 메인 커맨드 큐로부터 상기 제1 커맨드를 수신하고, 상기 카피 서치 유닛으로 상기 제1 커맨드를 출력하도록 구성된 제1 커맨드 큐;
상기 메인 커맨드 큐로부터 상기 제2 커맨드를 수신하고, 상기 비트맵 카운트 유닛으로 상기 제2 커맨드를 출력하도록 구성된 제2 커맨드 큐;
상기 메인 커맨드 큐로부터 상기 제3 커맨드를 수신하고, 상기 스캔 푸시 유닛으로 상기 제3 커맨드를 출력하도록 구성된 제3 커맨드 큐; 및
상기 카피 서치 유닛, 상기 비트맵 카운트 유닛, 및 상기 스캔 푸시 유닛 중 적어도 하나로부터 리턴 값을 수신하고, 상기 호스트로 상기 리턴 값을 출력하도록 구성된 리턴 큐를 포함하는 가비지 컬렉션 장치.
According to claim 5,
The host interface circuitry:
a main command queue configured to receive at least one of first to third commands from the host;
a first command queue configured to receive the first command from the main command queue and output the first command to the copy search unit;
a second command queue configured to receive the second command from the main command queue and output the second command to the bitmap count unit;
a third command queue configured to receive the third command from the main command queue and output the third command to the scan push unit; and
and a return queue configured to receive a return value from at least one of the copy search unit, the bitmap count unit, and the scan push unit, and to output the return value to the host.
제 5 항에 있어서,
상기 메모리 인터페이스 회로는:
상기 카피 서치 유닛, 상기 비트맵 카운트 유닛, 및 상기 스캔 푸시 유닛 중 적어도 하나와 연결되고, 상기 제1 객체의 상기 메타데이터를 저장하도록 구성된 메타데이터 캐시;
상기 비트맵 카운트 유닛 및 상기 스캔 푸시 유닛 중 적어도 하나와 연결되고, 상기 제1 객체가 포함된 메모리 공간에 대응하는 비트맵을 저장하도록 구성된 비트맵 캐시; 및
상기 메타데이터 캐시, 상기 비트맵 캐시, 및 상기 메모리 장치와 연결된 변환 색인 버퍼(translation lookaside buffer)를 포함하는 가비지 컬렉션 장치.
According to claim 5,
The memory interface circuit is:
a metadata cache connected to at least one of the copy search unit, the bitmap count unit, and the scan push unit and configured to store the metadata of the first object;
a bitmap cache connected to at least one of the bitmap count unit and the scan push unit and configured to store a bitmap corresponding to a memory space including the first object; and
A garbage collection device including a translation lookaside buffer connected to the metadata cache, the bitmap cache, and the memory device.
제1 내지 제3 커맨드들을 생성하도록 구성된 호스트;
상기 제1 내지 제3 커맨드들에 대응하는 제1 내지 제3 응답 신호들을 생성하도록 구성되고, 제1 및 제2 객체들을 포함하는 메모리 공간을 갖는 메모리 장치; 및
가비지 컬렉션 장치를 포함하는 메모리 컨트롤러를 포함하되,
상기 가비지 컬렉션 장치는:
상기 제1 응답 신호를 기반으로, 상기 제1 객체를 카피하거나, 또는 상기 제1 객체가 상기 제2 객체에 의해 참조되는지 여부를 가리키는 서치 값을 상기 호스트로 출력하도록 구성된 카피 서치 유닛;
상기 제1 객체가 상기 제2 객체에 의해 참조된다고 판별되면, 상기 제2 응답 신호를 기반으로, 상기 제1 객체의 크기 정보를 포함하는 비트 카운트 값을 상기 호스트로 출력하도록 구성된 비트맵 카운트 유닛; 및
상기 제3 응답 신호를 기반으로, 상기 제1 객체의 메타데이터를 갱신하거나, 또는 상기 제1 객체를 스택 메모리에 푸시하도록 구성된 스캔 푸시 유닛을 포함하는 메모리 시스템.
a host configured to generate first to third commands;
a memory device configured to generate first to third response signals corresponding to the first to third commands and having a memory space including first and second objects; and
A memory controller comprising a garbage collection device;
The garbage collection device:
a copy search unit configured to copy the first object or output a search value indicating whether the first object is referred to by the second object to the host, based on the first response signal;
a bitmap count unit configured to output a bit count value including size information of the first object to the host, based on the second response signal, when it is determined that the first object is referenced by the second object; and
and a scan push unit configured to update metadata of the first object or push the first object to a stack memory based on the third response signal.
제 8 항에 있어서,
상기 가비지 컬렉션 장치는 로직 레이어 상에 형성되고,
상기 메모리 장치는 제1 HMC(Hybrid memory cube)를 포함하고, 상기 제1 HMC는 상기 로직 레이어 상에 제1 방향으로 적층된 적어도 하나의 제1 DRAM(Dynamic Random Access Memory) 레이어를 포함하는 메모리 시스템.
According to claim 8,
The garbage collection device is formed on a logic layer,
The memory device includes a first hybrid memory cube (HMC), and the first HMC includes at least one first dynamic random access memory (DRAM) layer stacked on the logic layer in a first direction. .
제 9 항에 있어서,
상기 메모리 장치는 제2 내지 제4 HMC를 더 포함하고,
상기 호스트는 상기 로직 레이어로부터 상기 제1 방향에 수직한 제2 방향으로 이격되어 위치하고,
상기 제2 HMC는 상기 로직 레이어로부터 상기 제1 및 제2 방향으로 정의된 평면에 수직한 제3 방향으로 이격되어 위치하고,
상기 제3 HMC는 상기 로직 레이어로부터 상기 제2 방향의 반대 방향으로 이격되어 위치하고,
상기 제4 HMC는 상기 로직 레이어로부터 상기 제3 방향의 반대 방향으로 이격되어 위치하는 메모리 시스템.
According to claim 9,
The memory device further includes second to fourth HMCs,
The host is spaced apart from the logic layer in a second direction perpendicular to the first direction,
The second HMC is spaced apart from the logic layer in a third direction perpendicular to a plane defined by the first and second directions;
The third HMC is spaced apart from the logic layer in a direction opposite to the second direction;
The fourth HMC is spaced apart from the logic layer in a direction opposite to the third direction.
KR1020200125740A 2020-09-28 2020-09-28 Garbage collection device having subunit and memory system having the same KR102477775B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200125740A KR102477775B1 (en) 2020-09-28 2020-09-28 Garbage collection device having subunit and memory system having the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200125740A KR102477775B1 (en) 2020-09-28 2020-09-28 Garbage collection device having subunit and memory system having the same

Publications (2)

Publication Number Publication Date
KR20220043947A KR20220043947A (en) 2022-04-06
KR102477775B1 true KR102477775B1 (en) 2022-12-16

Family

ID=81211678

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200125740A KR102477775B1 (en) 2020-09-28 2020-09-28 Garbage collection device having subunit and memory system having the same

Country Status (1)

Country Link
KR (1) KR102477775B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007513437A (en) 2003-12-31 2007-05-24 インテル・コーポレーション Dynamic performance monitoring based approach to memory management
US20090327372A1 (en) 2008-06-26 2009-12-31 Tatu Ylonen Oy Ltd Garbage Collection via Multiobjects

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3140743B1 (en) * 2014-05-08 2021-11-24 Micron Technology, INC. Hybrid memory cube system interconnect directory-based cache coherence methodology
KR20200073604A (en) * 2018-12-14 2020-06-24 에스케이하이닉스 주식회사 Controller and operating method thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007513437A (en) 2003-12-31 2007-05-24 インテル・コーポレーション Dynamic performance monitoring based approach to memory management
US20090327372A1 (en) 2008-06-26 2009-12-31 Tatu Ylonen Oy Ltd Garbage Collection via Multiobjects

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
차창일 외 5명, "임베디드 자바 가상머신을 위한 가비지 컬렉터 개발", 제25회 한국정보처리학회 춘계학술발표대회 논문집 제13권 제1호, 2006.05.31.

Also Published As

Publication number Publication date
KR20220043947A (en) 2022-04-06

Similar Documents

Publication Publication Date Title
US11681473B2 (en) Memory system and control method
US11093137B2 (en) Memory system and method for controlling nonvolatile memory
US10318434B2 (en) Optimized hopscotch multiple hash tables for efficient memory in-line deduplication application
US11748256B2 (en) Memory system and method for controlling nonvolatile memory
US11347655B2 (en) Memory system and method for controlling nonvolatile memory
US6453403B1 (en) System and method for memory management using contiguous fixed-size blocks
US6728852B1 (en) Method and apparatus for reducing heap size through adaptive object representation
US9966152B2 (en) Dedupe DRAM system algorithm architecture
CN108897642B (en) Method and device for optimizing log mechanism in persistent transactional memory system
US20170004069A1 (en) Dynamic memory expansion by data compression
CN108959113B (en) Method and system for flash aware heap memory management
US20230367637A1 (en) Shared memory management method and device
CN113760560A (en) Inter-process communication method and inter-process communication device
US20230273750A1 (en) Memory system and method of controlling nonvolatile memory with checking a total size indicative of a sum of data length specified by a write command
US8473691B2 (en) Memory management device, image forming apparatus, and image forming method
US20170220482A1 (en) Manipulation of virtual memory page table entries to form virtually-contiguous memory corresponding to non-contiguous real memory allocations
KR20170084675A (en) Method of accessing data with in a memory, and memory device using the method
US11550504B2 (en) System including an application processor and a data storage device providing data
KR102477775B1 (en) Garbage collection device having subunit and memory system having the same
US20230236730A1 (en) Storage device and storage system
TW202338810A (en) Nonvolatile storage device, host, and method of controlling nonvolatile storage device
US11429519B2 (en) System and method for facilitating reduction of latency and mitigation of write amplification in a multi-tenancy storage drive
EP3819771B1 (en) Data processing method and device, apparatus, and system
Cockshott Addressing mechanisms and persistent programming
JP7366222B2 (en) Memory system and control method

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant