가장 많이 묻는 면접 질문과 답변 & 온라인 테스트
면접 준비, 온라인 테스트, 튜토리얼, 라이브 연습을 위한 학습 플랫폼

집중 학습 경로, 모의고사, 면접 준비 콘텐츠로 실력을 키우세요.

WithoutBook은 주제별 면접 질문, 온라인 연습 테스트, 튜토리얼, 비교 가이드를 하나의 반응형 학습 공간으로 제공합니다.

Prepare Interview

모의 시험

홈페이지로 설정

이 페이지 북마크

이메일 주소 구독
/ 면접 주제 / Java Garbage Collection
WithoutBook LIVE Mock Interviews Java Garbage Collection Related interview subjects: 39

Interview Questions and Answers

Know the top Java Garbage Collection interview questions and answers for freshers and experienced candidates to prepare for job interviews.

Total 30 questions Interview Questions and Answers

The Best LIVE Mock Interview - You should go through before interview

Know the top Java Garbage Collection interview questions and answers for freshers and experienced candidates to prepare for job interviews.

Interview Questions and Answers

Search a question to view the answer.

Freshers / Beginner level questions & answers

Ques 1

What is Garbage Collection in Java?

Garbage Collection is the automatic process of reclaiming the runtime unused memory by destroying the objects that are no longer reachable or referenced by the program.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 2

What is the role of the JVM (Java Virtual Machine) in garbage collection?

The JVM is responsible for managing the memory, including garbage collection. It runs the garbage collector to identify and reclaim unused memory.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 3

What is the purpose of the Young Generation in the Java heap?

The Young Generation is the part of the heap where new objects are created. It is designed for short-lived objects, and garbage collection occurs more frequently in this generation.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 4

What is the purpose of the 'finalize()' method in Java?

The 'finalize()' method is called by the garbage collector before an object is reclaimed. It allows an object to perform cleanup operations before being garbage collected.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 5

What is the role of the Old Generation in the Java heap?

The Old Generation is the part of the heap that holds long-lived objects. Objects that survive multiple garbage collection cycles in the Young Generation are eventually promoted to the Old Generation.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 6

What is the purpose of the 'System.gc()' method in Java?

The 'System.gc()' method is a hint to the JVM that suggests running the garbage collector. However, its actual execution is at the discretion of the JVM, and it may be ignored in some implementations.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 7

Explain the role of the '-XX:+UseG1GC' JVM option in enabling the G1 garbage collector.

The '-XX:+UseG1GC' option is used to enable the G1 garbage collector in Java. It instructs the JVM to use the G1 collector as the garbage collection algorithm.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments

Intermediate / 1 to 5 years experienced level questions & answers

Ques 8

Explain the purpose of the finalize() method.

The finalize() method is called by the garbage collector before reclaiming the memory occupied by an object. It can be overridden to perform cleanup operations before an object is garbage collected.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 9

Name the different types of garbage collectors in Java.

The types of garbage collectors in Java include Serial Garbage Collector, Parallel Garbage Collector, CMS (Concurrent Mark-Sweep) Garbage Collector, and G1 (Garbage-First) Garbage Collector.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 10

Explain the difference between 'gc()' and 'System.gc()' in Java.

'gc()' is a hint to the garbage collector to run, while 'System.gc()' is a method that suggests to the JVM to run the garbage collector, but the actual execution is at the discretion of the JVM.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 11

Explain the concept of Generational Garbage Collection.

Generational Garbage Collection is based on the observation that most objects become unreachable shortly after they are created. It divides the heap into two main areas: the Young Generation and the Old Generation.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 12

What is the Eden Space in the Young Generation of the Java heap?

The Eden Space is the part of the Young Generation where new objects are initially allocated. Objects surviving garbage collection in Eden are moved to the Survivor Spaces.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 13

Explain the purpose of the Survivor Spaces in the Young Generation.

The Survivor Spaces (S0 and S1) in the Young Generation are used to hold objects that survive one garbage collection cycle in the Eden Space. Objects can be promoted to the Old Generation from the Survivor Spaces.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 14

What is the difference between garbage collection and memory leak?

Garbage collection is the process of automatically identifying and reclaiming unused memory, while a memory leak occurs when the application fails to release memory that is no longer needed, leading to increased memory consumption over time.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 15

What is the 'OutOfMemoryError' in Java, and how is it related to garbage collection?

The 'OutOfMemoryError' is an exception thrown when the Java Virtual Machine (JVM) runs out of memory. It can occur if the garbage collector is unable to free up enough memory to satisfy the memory allocation request.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 16

Explain the concept of garbage collection ergonomics in Java.

Garbage collection ergonomics involves the JVM automatically tuning garbage collection parameters based on the characteristics of the application, such as heap size, pause time goals, and allocation rates.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 17

What is the role of the '-Xmx' and '-Xms' JVM options in garbage collection?

The '-Xmx' option sets the maximum heap size, while the '-Xms' option sets the initial heap size. Properly configuring these options can impact garbage collection performance and overall application memory usage.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 18

Explain the concept of 'Garbage Collection Roots' in Java.

Garbage Collection Roots are objects that are considered to be reachable at all times and serve as starting points for the garbage collector. Examples include local variables, active threads, and static variables.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 19

How can you monitor and analyze garbage collection performance in Java?

Garbage collection performance can be monitored using tools like VisualVM, JConsole, and other profiling tools. Analyzing garbage collection logs and metrics helps identify issues and optimize performance.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 20

What is the 'CMSInitialMarkPause' phase in the CMS garbage collector?

The 'CMSInitialMarkPause' is the initial phase of the CMS (Concurrent Mark-Sweep) garbage collector. During this phase, the collector identifies and marks live objects in the Old Generation while briefly pausing application threads.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments

Experienced / Expert level questions & answers

Ques 21

What is the PermGen space, and is it still used in Java 8 and later?

PermGen (Permanent Generation) space was used to store metadata related to classes. In Java 8 and later, PermGen space is replaced by Metaspace, which is more flexible and avoids memory leaks related to class metadata.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 22

Explain the concept of garbage collection tuning in Java.

Garbage collection tuning involves configuring the garbage collector to meet specific performance goals. It includes selecting the appropriate garbage collector algorithm and adjusting related parameters.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 23

Explain the concept of garbage collection pause times.

Garbage collection pause times refer to the periods during which application threads are stopped while the garbage collector performs its tasks. Minimizing pause times is essential for maintaining application responsiveness.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 24

Explain the concept of the 'garbage-first' (G1) garbage collector.

The G1 garbage collector is designed to provide high throughput and low-latency garbage collection. It divides the heap into regions and uses a series of Garbage-First (GF) queues to prioritize collection of regions with the most garbage.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 25

How does the Java Virtual Machine (JVM) handle circular references in garbage collection?

The JVM uses a reachability analysis to determine if objects are reachable or not. Circular references are handled by the garbage collector, which identifies and collects objects that are no longer reachable.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 26

What is the 'Reference' class in Java, and how is it used in garbage collection?

The 'Reference' class is part of the java.lang.ref package and provides a way to create and manipulate references to objects. It is often used in advanced memory management scenarios and garbage collection.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 27

Explain the concept of 'GC overhead limit exceeded' error in Java.

The 'GC overhead limit exceeded' error occurs when the JVM spends too much time on garbage collection, exceeding a specified threshold (98% by default) of the total time. It indicates a potential performance issue.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 28

Explain the concept of 'Card Table' in the context of the G1 garbage collector.

The 'Card Table' is a data structure used by the G1 garbage collector to track changes in the heap. It allows the collector to efficiently identify and collect only the regions of the heap containing modified objects.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 29

What is the 'CMSConcurrentAbortablePreclean' phase in the CMS garbage collector?

The 'CMSConcurrentAbortablePreclean' is a phase in the CMS (Concurrent Mark-Sweep) garbage collector that performs additional work on the Old Generation to prepare for the final mark phase. It is concurrent and aims to minimize pause times.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments
Ques 30

Explain the concept of 'Shenandoah' garbage collector in Java.

Shenandoah is a low-pause-time garbage collector introduced in Java. It uses advanced techniques to perform garbage collection concurrently with application threads, minimizing pause times and improving overall responsiveness.
복습용 저장

복습용 저장

이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.

내 학습 라이브러리 열기
도움이 되었나요?
Add Comment View Comments

Most helpful rated by users:

Copyright © 2026, WithoutBook.