Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Do Gophers Dream of Stack Overflow?
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Takuto Nagami
May 22, 2026
59
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Do Gophers Dream of Stack Overflow?
May 22, 2026: Slides for the presentation at GopherCon Singapore.
Takuto Nagami
May 22, 2026
More Decks by Takuto Nagami
See All by Takuto Nagami
GopherCon @シアトル に行ってきました
logica0419
0
580
型落ちシンクライアント端末のPoEモジュールを自作したかった話
logica0419
0
590
The Journey of Connecting Japan to the Global Go Community
logica0419
1
120
Discovering Cilium: What eBPF Enabled in K8s Networking
logica0419
0
120
今こそ学びたいKubernetesネットワーク ~CNIが繋ぐNWとプラットフォームの「フラッと」な対話
logica0419
10
1.5k
キャリア科目では教えてくれない、就活を生き抜く法則
logica0419
2
320
歴史から学ぶ、Goのメモリ管理基礎
logica0419
17
4.4k
【2025改訂版】ITエンジニアとして知っておいてほしい、電子メールという大きな穴
logica0419
2
350
Fundamentals of Memory Management in Go: Learning Through the History
logica0419
1
190
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
840
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.8k
The Pragmatic Product Professional
lauravandoore
37
7.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
910
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
A Modern Web Designer's Workflow
chriscoyier
699
190k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
550
Believing is Seeing
oripsolob
1
220
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
320
Transcript
Takuto Nagami @logica0419 Do Gophers Dream of Stack Overflow?
Ever heard of stack overflow?
Ever heard of stack overflow? No this one today!
Stack memory (and heap memory)
RAM from the application perspective . . . • Key-value
store ◦ Key: Memory address ◦ Value: 1 byte for each addr • Most of high-level language (including Go) divides this store into two areas: Stack and Heap 0x0000 0x0001 0x0002 0x0003
. . . Stack memory area
. . . main() stack frame Stack memory area
. . . main() stack frame 5 Stack memory area
{v addr}
. . . main() stack frame 5 a() stack frame
Stack memory area {v addr}
. . . main() stack frame 5 a() stack frame
5 Stack memory area {arg addr} {v addr}
. . . main() stack frame 5 a() stack frame
5 7 Stack memory area {arg addr} {a addr} {v addr}
. . Stack memory area main() stack frame 5 a()
stack frame {arg addr} {a addr} {v addr} 5 7 b() stack frame
. . Stack memory area main() stack frame 5 a()
stack frame {arg addr} {arg addr} {a addr} {v addr} 5 7 b() stack frame 7
. . Stack memory area main() stack frame 5 a()
stack frame {arg addr} {b addr} {arg addr} {a addr} {v addr} 5 7 b() stack frame 7 1
. . . Stack memory area main() stack frame 5
a() stack frame {arg addr} {a addr} {v addr} 5 7
. . . Stack memory area main() stack frame 5
{v addr}
. . . Stack memory area Program exits
Stack is not a silver bullet... • Can’t handle unknown
data size (maps/slices) ◦ Stack allocation is compiler’s duty • Sometimes can’t share variables between functions → These go to heap memory area
Stack overflow (primary meaning)
Stack overflow • Language decides border between heap and stack
◦ e.g., in C on Linux, stack size is 8MB . . . . . Heap var main() stack frame
Stack overflow • Going over the stack limit with nested
function
Stack overflow • Going over the stack limit with nested
function → Stack overflow!!
Flexible stack 【Go specific】
Go has flexible stack • Stack for each goroutine •
Each stack grows and shrinks on demand ◦ Initialized with 4kB
Rough idea main goroutine main() stack frame a() stack frame
a2() stack frame a3() stack frame a4() stack frame m2() stack frame b() stack frame a goroutine b goroutine
Can Go still cause a stack overflow despite having a
flexible stack?
Flexible stack → No stack overflow?
No stack overflow? Stack overflow still exists in Go!
Because: Each goroutine has a stack size limit It’s defined
in the “runtime” package
Maximum stack size • Set to 1MiB on startup ◦
runtime/stack.go
Maximum stack size • Final size is defined when main
goroutine starts ◦ runtime/proc.go ◦ 250MB for 32bit, 1GB for 64bit
Let’s see an actual stack overflow! • Go says “fatal
error: stack overflow” ◦ 6 million+ functions were nested
Modifying the max size • Override with runtime/debug.SetMaxStack()
Modifying the max size • The same experiment with 8
MB of stack size ◦ Nested functions: 6 million -> 52,000
Wrapup Go’s stack does overflow
Thank you! Let’s have a nice conference!