SlideShare a Scribd company logo
1 of 36
Download to read offline
2020.04.17 김다은
CSW W1 발표
메모리에서의 자료구조
🚨앞으로 설명할 메모리는 하드웨어메모리가 아닌 가상메모리입니다🚨
가상메모리는 운영체제가 관리
목차📄
1. 메모리구조
2. 스택
3. 힙
1. 메모리구조⚙
1. 메모리구조⚙
힙 영역
- 자유롭게 할당하고 해제할 수 있는 영역
- 개발자가 관리
1. 메모리구조⚙
힙 영역
👩💻
DATA
(0x0718)
DATA
(0x2002) DATA
(0x0408)
DATA
(0x0923)
1. 메모리구조⚙
힙 영역
👩💻
DATA
(0x1128)
DATA
(0x0718)
DATA
(0x2002) DATA
(0x0408)
DATA
(0x0923)
1. 메모리구조⚙
힙 영역
👩💻
DATA
(0x1128)
DATA
(0x0718)
DATA
(0x2002)
DATA
(0x0525)
DATA
(0x0408)
DATA
(0x0923)
1. 메모리구조⚙
힙 영역
👩💻
DATA
(0x1128)
DATA
(0x1214)
DATA
(0x0718)
DATA
(0x2002)
DATA
(0x0525)
DATA
(0x0408)
DATA
(0x0923)
1. 메모리구조⚙
힙 영역
👩💻
DATA
(0x1128)
DATA
(0x1214)
DATA
(0x0718)
DATA
(0x2002) DATA
(0x1209)
DATA
(0x0525)
DATA
(0x0408)
DATA
(0x0923)
1. 메모리구조⚙
스택 영역
- 지역변수, 매개변수
- 함수호출 -> 할당
- 함수호출완료 -> 소멸
1. 메모리구조⚙
스택 영역
함수1 {
함수2()
}
함수2 {
함수3()
함수4()
}
👉
1. 메모리구조⚙
스택 영역
함수 1
함수1 {
함수2()
}
함수2 {
함수3()
함수4()
}
👉
1. 메모리구조⚙
스택 영역
함수 1
함수 2
함수1 {
함수2()
}
함수2 {
함수3()
함수4()
}
👉
1. 메모리구조⚙
스택 영역
함수 1
함수 2
함수3
함수1 {
함수2()
}
함수2 {
함수3()
함수4()
}
👉
1. 메모리구조⚙
스택 영역
함수 1
함수 2
함수1 {
함수2()
}
함수2 {
함수3()
함수4()
}
👉
1. 메모리구조⚙
스택 영역
함수 1
함수 2
함수 4
함수1 {
함수2()
}
함수2 {
함수3()
함수4()
}
👉
스택은 스택!
그렇다면,, 힙도 힙⁉
스택은 스택!
그렇다면,, 힙도 힙⁉🤷
자료구조
스택
메모리
스택영역
자료구조
힙
메모리
힙영역
2. 스택📨
자료구조 스택
DATA
DATA
DATA DATA
2. 스택📨
메모리 스택영역
함수 1
함수 2
함수 4 함수3
함수1 {
함수2()
}
함수2 {
함수3()
함수4()
}
2. 스택📨
메모리 스택영역
함수 1
함수 2
함수 4 함수3
함수1 {
함수2()
}
함수2 {
함수3()
함수4()
}
👉
⭕메모리의 스택영역은 스택 자료구조를 사용하여 구현하기 적합하다⭕
3. 힙📚
자료구조 힙
- 완전 이진 트리의 일종
- 우선순위 큐를 위하여 만들어짐
https://gmlwjd9405.github.io/2018/05/10/data-structure-heap.html
3. 힙📚
메모리 힙영역
👩💻
DATA
(0x1)
DATA
(0x2)
DATA
(0x04)
DATA
(0x3)OS
3. 힙📚
메모리 힙영역
👩💻
DATA
(0x1)
DATA
(0x2)
DATA
(0x04)
DATA
(0x3)
2개의 데이터를
담을 메모리가
필요해!
OS
3. 힙📚
메모리 힙영역
👩💻
OS
DATA
(0x1)
DATA
(0x2)
DATA
(0x04)
DATA
(0x3)
DATA
(0x10)
DATA
(0x11)
3. 힙📚
메모리 힙영역
👩💻
OS
메모리 블록에 공간이
부족하니 메모리 블록을 늘려서
할당해줘야겠다!
DATA
(0x1)
DATA
(0x2)
DATA
(0x04)
DATA
(0x3)
DATA
(0x10)
DATA
(0x11)
🚨메모리 사용량의 최대 2배 할당🚨
3. 힙📚
메모리 블록(1) 메모리 블록(4) 메모리 블록(0) 메모리 블록(10)
3. 힙📚
메모리 블록(1) 메모리 블록(4) 메모리 블록(0) 메모리 블록(10)
여기에 담아야겠군!
⭕메모리의 힙영역은 연결리스트 자료구조를 사용하여 구현하기 적합하다⭕
이 링크에 따르면 힙알고리즘이
사용가능한 메모리를 찾는데에 사용된대.
(힙 자료구조를 힙 영역에 사용한다는 링크 속 글 인용)
아니야 필자는 'heap'이라는 이름에 근거해 연관성이 있다고
추측하고 있으며, 아마도 착각하고 있는 것 같아
리눅스에서 사용되는 Binary Buddy 시스템에서는
데이터를 분할하는 방법 때문에 Binary Tree로 나타낼 수 있어.

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

컴퓨터공학 스터디 W1 발표: 메모리구조에서의 자료구조