MaNiAcCoder3 Profile Banner
Kaव्य Profile
Kaव्य

@MaNiAcCoder3

Followers
51
Following
151
Media
8
Statuses
256

caffeinated coder by day, highly caffeinated coder by night. compsci grad @_PECChandigarh

India
Joined November 2021
Don't wanna be here? Send us removal request.
@wojakcodes
‎Wojak Codes
1 month
Imagine how hard life would be if every fresher was cracked af and grinded LC. I thank MERN youtubers everyday for lobotomising these fresh grads. Every time I see someone struggle with reversing a linkedlist, I can’t stop smiling. one less guy I have to worry about. When I
96
42
1K
@MaNiAcCoder3
Kaव्य
1 month
In Go, if you store every submitted goroutine in a global https://t.co/L5OFm8Vylx for tracking — you’re not monitoring tasks, you’re collecting them forever How do you: -remove task refs after execution? -avoid static maps in Go? -use errgroup or context for lifecycle tracking?
0
0
0
@MaNiAcCoder3
Kaव्य
1 month
Gonna start solving some Interesting System Design LLD HLD problems from now on just to work more on Golang
1
0
0
@rfleury
Ryan Fleury
2 months
>I can use a library written by someone else, without any worries that it will break my own code The poser-engineering reality of modern software development captured in a single sentence
@oxcrowx
oxcrow
2 months
Not learning Rust is a mistake. Name another language where I can use a library written by someone else, without any worries that it will break my own code? The headache of learning Rust is significantly less than the mental trauma caused by having to fix bugs in production.
58
94
2K
@MaNiAcCoder3
Kaव्य
2 months
Let the task lifecycle define object lifetime , not global maps. In Go, global state is rarely needed. Prefer goroutines, contexts, and sync primitives for cleaner, leak-free design. #Golang #MemoryManagement #GoLangTips
0
0
0
@MaNiAcCoder3
Kaव्य
2 months
✅ Fix 4: Just use sync.WaitGroup or errgroup Group. They exist exactly to track task lifecycles safely: g.Go(func() error { return task() }) No global maps. No leaks. Cleaner concurrency.
1
0
0
@MaNiAcCoder3
Kaव्य
2 months
Go doesn’t have WeakHashMap, but you can mimic it. Run a cleanup goroutine that periodically prunes completed tasks: func CleanupCompletedTasks() { ... } This keeps memory under control when tracking tasks is unavoidable.
1
0
0
@MaNiAcCoder3
Kaव्य
2 months
✅ Fix 2: Use context.Context or channels. Instead of tracking tasks in a global map, let each task manage its own lifecycle. When the context is cancelled, the goroutine exits , no leaks, no global state.
1
0
0
@MaNiAcCoder3
Kaव्य
2 months
✅ Fix 1: Explicit cleanup defer submittedTasks.Delete(taskID) Right after your goroutine completes, remove its reference. Simple, reliable, and the easiest way to keep memory stable.
1
0
0
@MaNiAcCoder3
Kaव्य
2 months
This is Go’s version of a Java static Map memory leak. ➡️ Tasks complete ➡️ References never removed ➡️ Heap grows slowly ➡️ GC works harder each cycle Your service feels “fine” at first… until uptime hits weeks. 😬
1
0
0
@MaNiAcCoder3
Kaव्य
2 months
It starts innocently: var submittedTasks = https://t.co/L5OFm8Vylx{} func SubmitTask(taskID int64, task func()) { https://t.co/fB1beRX5RC(taskID, task) go task() } Every submitted task is stored forever even after it completes.GC can’t reclaim memory because references are live
1
0
0
@MaNiAcCoder3
Kaव्य
2 months
Ever seen a Go service slowly eat memory over time? 👀 You might be holding onto tasks long after they’re done — a classic static map leak, but in Go. Let’s break down how this happens (and fix it properly). 🧵 #Golang #MemoryLeak #Concurrency
1
0
0
@MaNiAcCoder3
Kaव्य
2 months
Go’s io.Reader/io.Writer interfaces make it perfect for streaming binary AV data. Pair that with FFmpeg bindings and you can build a concurrent AV analyzer with zero external daemons.
0
0
0
@MaNiAcCoder3
Kaव्य
2 months
In just a few hundred lines, this Go service handles: 🎥 Video fetching 🎧 Audio normalization 📦 HLS packaging 🖼️ Cover compression ☁️ Cloud upload That’s the beauty of Go — minimalism with real-world muscle 💪 #Golang #SystemDesign #BackendDev
1
0
0
@MaNiAcCoder3
Kaव्य
2 months
Finally, all the processed segments, manifests, and cover files are uploaded back to S3. Fully automated, fault-tolerant, and blazing fast. #AWS #GoLang #S3
1
0
0
@MaNiAcCoder3
Kaव्य
2 months
Even the cover image isn’t left out. It’s downloaded, compressed, and optimized for the web — keeping everything efficient in storage and delivery. #GoLang #ImageProcessing
1
0
0
@MaNiAcCoder3
Kaव्य
2 months
Next comes the magic: encoding 🎬 Some videos don’t even have audio, but HLS requires one — so it adds a silent track automatically before converting to HLS. Smart and resilient. #FFmpeg #MediaProcessing
1
0
0
@MaNiAcCoder3
Kaव्य
2 months
The system then fetches the raw video straight from S3. No external tools, no dependencies — just Go’s native I/O and concurrency doing their job flawlessly. #AWS #GoLang
1
0
0
@MaNiAcCoder3
Kaव्य
2 months
It all starts in a temporary workspace — every video gets its own isolated environment. When processing finishes, everything is cleaned up automatically. Simple. Predictable. Elegant. #GoLang #CleanCode
1
0
0
@MaNiAcCoder3
Kaव्य
2 months
Just made a Go module that processes videos — downloads, encodes to HLS, compresses cover images, and uploads to S3. Here’s a breakdown of how this works under the hood 👇 #Golang #VideoProcessing #AWS
1
0
0