Home / Companies / Tailscale / Blog / Post Details
Content Deep Dive

Hey linker, can you spare a meg?

Blog post from Tailscale

Post Details
Company
Date Published
Author
Josh Bleecher Snyder
Word Count
2,339
Language
-
Hacker News Points
-
Summary

Tailscale's blog post discusses the challenges and solutions related to optimizing memory usage for their iOS app, which operates as a Network Extension and faces a stringent 15MB memory limit. The team initially tackled memory inefficiencies by analyzing their app's baseline operation, optimizing the Go runtime's garbage collector, and adjusting system thread usage. Despite these efforts, they discovered that iOS's memory accounting—with a significant portion attributed to relocations in the __DATA_CONST category—was a major factor, leading them to improve the Go linker to reduce relocations, resulting in memory savings. Their changes not only benefited their app but also enhanced Go's performance across different systems. In an unexpected twist, while their linker improvements saved roughly 1MB, the release of iOS 15 provided an additional 35MB of memory, alleviating their constraints significantly.