| ▲ | lifthrasiir 5 days ago |
| GC doesn't exactly solve your memory problem; it typically means that your memory problem gets deferred quite far until you can't ignore that. Of course it is also quite likely that your program will never grow to that point, which is why GC works in general, but also why there exists a desire to avoid it when makes sense. |
|
| ▲ | mjburgess 5 days ago | parent | next [-] |
| Not sure why you're down-voted, this is correct. In games you have 16ms to draw billion+ triangles (etc.). In web, you have 100ms to round-trip a request under abitarily high load (etc.) Cases where you cannot "stop the world" at random and just "clean up garbage" are quite common in programming. And when they happen in GC'd languages, you're much worse off. |
| |
| ▲ | Tomte 5 days ago | parent | next [-] | | That's why it's good that GC algorithms that do not "stop the world" have been in production for decades now. | | |
| ▲ | pebal 4 days ago | parent [-] | | There are none, at least not production grade. | | |
| ▲ | kelseyfrog 4 days ago | parent | next [-] | | There are none, or you're not aware of their existence? | | |
| ▲ | pebal 4 days ago | parent [-] | | There are no production implementations of GC algorithms that don't stop the world at all. I know this because I have some expertise in GC algorithms. | | |
| ▲ | kelseyfrog 4 days ago | parent [-] | | I'm curious why you don't consider C4 to be production grade | | |
| ▲ | pebal 4 days ago | parent [-] | | Azul C4 is not a pauseless GC. In the documentation it says "C4 uses a 4-stage concurrent execution mechanism that eliminates almost all stop-the-world pauses." | | |
| ▲ | kelseyfrog 4 days ago | parent [-] | | Except the documentation says > C4 differentiates itself from other generational garbage collectors by supporting simultaneous-generational con-
currency: the different generations are collected using concurrent (non stop-the-world) mechanisms | | |
|
|
|
| |
| ▲ | worthless-trash 4 days ago | parent | prev [-] | | I have heard (and from when I investigated) erlangs GC is 'dont stop the world'. Maybe my definition is bad though. |
|
| |
| ▲ | immibis 5 days ago | parent | prev [-] | | Java's ZGC claims O(1) pause time of 0.05ms. (As with any low-pause collector, the rest of your code is uniformly slower by some percentage because it has to make sure not to step on the toes of the concurrently-running collector.) | | |
| ▲ | Ygg2 5 days ago | parent | next [-] | | > Java's ZGC claims O(1) pause time of 0.05ms In practice it's actually closer to 10ms for large heaps. Large being around 220 GB. | |
| ▲ | riku_iki 5 days ago | parent | prev [-] | | With Java, the issue is that each allocated object carries significant memory footprint, as result total memory consumption is much higher compared to C++: https://benchmarksgame-team.pages.debian.net/benchmarksgame/... | | |
| ▲ | igouy 4 days ago | parent [-] | | The benchmarks game shows memory use with default GC settings (as a way to uncover space-time tradeoffs), mostly for tiny tiny programs that hardly use memory. Less difference — mandelbrot, k-nucleotide, reverse-complement, regex-redux — when the task requires memory to be used. Less with GraalVM native-image: https://benchmarksgame-team.pages.debian.net/benchmarksgame/... | | |
| ▲ | riku_iki 4 days ago | parent [-] | | > Less difference — mandelbrot, k-nucleotide, reverse-complement, regex-redux — when the task requires memory to be used. yes, I referred to benchmarks with large memory consumption, where Java still uses from 2 to 10(as in binary tree task) more memory, which is large overhead. |
|
|
|
|
|
| ▲ | sph 5 days ago | parent | prev | next [-] |
| That’s fair, no resource is unlimited. My point is that memory is usually the least of one’s problem, even on average machines. Productivity and CPU usage tend to be the bottleneck as a developer and a user. GC is mostly a performance problem rather than a memory one, and well-designed language can minimize the impact of it. (I am working on a message-passing language, and only allowing GC after a reply greatly simplifies the design and performance characteristics) |
| |
| ▲ | charleslmunger 4 days ago | parent [-] | | >My point is that memory is usually the least of one’s problem, even on average machines. The average machine a person directly interacts with is a phone or TV at this point, both of which have major BoM restrictions and high pixel density displays. Memory is the primary determination of performance in such environments. On desktops and servers, CPU performance is bottlenecked on memory - garbage collection isn't necessarily a problem there, but the nature of separate allocations and pointer chasing is. On battery, garbage collection costs significant power and so it gets deferred (at least for full collections) until it's unavoidable. In practice this means that a large amount of heap space is "dead", which costs memory. Your language sounds interesting - I've always thought that it would be cool to have a language where generational GC was exposed to the programmer. If you have a server, you can have one new generation arena per request with a write barrier for incoming references from the old generation to the new. Then you could perform young GC after every request, only paying for traversal+move of objects that survived. |
|
|
| ▲ | throwawaymaths 5 days ago | parent | prev [-] |
| eh, there are GC languages famous for high uptimes and deployed in places where it "basically runs forever with no intervention", so in practice with the right GC and application scope, "deferring the concern till the heat death of the universe" (or until a CVE forces a soft update) is possible. |
| |
| ▲ | lifthrasiir 4 days ago | parent [-] | | That's exactly why I said "it is also quite likely that your program will never grow to that point". Of course you need non-trivial knowledge to determine whether your application and GC satisfy that criteria. |
|