"It will solve memory leaks!"
...
"whoops, you can still leak memory in garbage collected languages, my bad everyone!".
"It will solve memory leaks!"
...
"whoops, you can still leak memory in garbage collected languages, my bad everyone!".
Had to wait on a patch for .net... not a problem anymore today, although I don't know the details how they solved the problem.
which speaks how rare they are
I also suggest you say 5 years instead of "half-a-decade", most of us see through that and it's off-putting.
I have seen two instances of rooted memory:
- WPF. The implicit GC root path introduced by events. We were easily able to track this down due to the information that the GC holds in memory[1] (fixing it was not so easy).
- A leak in managed C++ (non-pure, i.e. native code). We had to use the normal tools to track this down, not a 5 minute diagnosis.
At the end of the day GC'd languages can have (and usually do) richer tooling surrounding memory usage. They are better in this regard even during a failure state.
[1]: https://learn.microsoft.com/en-us/dotnet/core/diagnostics/so...
Getting rid of C won't get rid of security problems anymore than moving to java and .net got rid of needing to think about memory leaks.
Those that think otherwise are ignorant of history, or choosing to ignore it.
And it gets worse when you consider resource exhaustion, not just memory. There are entire mechanisms in .net and java whose sole purpose in life is to try and deal with resource exhaustion because the GC only deals with 1 aspect of that resource exhaustion (memory leaks).
---
For those of us who watched that transition, it's obvious it won't work out the way people are claiming.
I say this as someone who does high-level languages as a day job, and doesn't find them to be a problem personally, but, yeah, Java as a concept still allows some unintuitive footguns like that.
Difference in magnitude of impact, difference in the response of the standards organizations in handling it, but yeah it's certainly same kind of footgun as C lets you do. The difference being that Java has devoted an enormous amount of resources to squashing these errors and they largely aren't a problem anymore, where C is afraid to touch the "undefined behavior" and "implementation dependent" sacred cows.
Is there an unspoken social contract between language committee and language users that aliasing a variable or causing a circular reference should not shoot your dog and burn down the house? That's the fundamental disagreement between Java and C's standards bodies.
> it could slightly reduce