S
25

Vent: My first project crashed because I didn't know about memory leaks

Last week, I finally got my little weather app to run after a month of work. It pulled data for my city, Denver, and showed the forecast. After about 3 hours, it just froze and shut down. I spent two whole days trying to find the bug, and it turned out my loop was creating new objects every second and never clearing them out. I had no idea that was even a thing you had to manage. How are you supposed to know about stuff like that when you're just starting? Has anyone else had a simple project blow up from something you never learned about?
3 comments

Log in to join the discussion

Log In
3 Comments
seanlee
seanlee2mo ago
Wait, you had objects piling up every single second? That's a brutal way to find out about memory management. Gavin_hill27 calling it a rite of passage is wild to me, because that's not a small oversight. That's a core concept that should be explained early on. It's crazy that you had to lose days of work just to learn something so basic about how code runs.
9
gavin_hill27
Honestly sounds like a rite of passage. Memory leaks are annoying but that crash probably taught you more than any tutorial would have.
8
eric723
eric7233mo ago
Tbh calling it a "rite of passage" like gavin_hill27 did just makes bad teaching sound normal. You shouldn't need a total crash to learn basic stuff, that's a failure of how we teach coding. Honestly it just sets beginners up to waste time and get frustrated.
6