3 ms·
It does require more memory for tracking objects as well as storing objects longer than they are strictly necessary. So I would argue that manual memory managem
by simpsond 4y ago
It does require more memory for tracking objects as well as storing objects longer than they are strictly necessary. So I would argue that manual memory management is most useful when there are memory constraints. But yes, GCd systems can yield more throughput. They are also easier to work with IMO.
- adgjlsfhk1 4y agothis is only kind of true. garbage collectors can use lots of tricks like alias analysis to automatically free objects without involving the garbage collector, and manually managed languages actually may keep objects around for longer than gced ones because manual management can only use compile time information to determine lifetimes, but GCs get run time info. also, for both types, the trash performance win is avoiding unnecessary allocations in the first place.
- jjtheblunt 4y ago> garbage collectors can use lots of tricks like ... without involving the garbage collector is there a typo: X can use tricks to avoid X ?
- adgjlsfhk1 4y agoMore awkward phrasing due to the line between garbage collectors, compilers and language runtimes being fuzzy. What I mean is that the compiler at compile time decides to act as an alternative garbage collector by allocating and de-allocating the objects in a way that is invisible to the mark and sweep portion.