2 ms·
About Boehm GC, somebody told me a story about using it at his job for a highly technical simulation program that they sell... it worked unless the customer had
by ahartmetz 7y ago
About Boehm GC, somebody told me a story about using it at his job for a highly technical simulation program that they sell... it worked unless the customer had data that fooled the GC into thinking it was seeing pointers in data that wasn't pointers, so it never freed memory. I guess it was in 32 bits with much smaller address space. They ended up switching to manual memory management, which wasn't significantly more complicated (in C++).
Such are the tradeoffs with a conservative garbage collector.
I would avoid Boehm GC (and other conservative GCs) in almost all situations.
- DmitryOlshansky 7y agoHave been writing in D that has conservative GC for years. Yes, on 32-bit platform false pointers are a problem esp as you get closer to 1g for instance. On the other hand on 64-bit I’ve never seen it at all. The chance of arbitrary long/double to point to some object in the heap area is 1/2^32 smaller and that turns the problem from common nuisance to purely theoretical problem.
- throwaway_pdp09 7y agoI agree. @camgunz' post is very naive. I never use a tool unless I understand it, and having read up on various GCs, conservative GCs are not something I could ever trust in production. False pointers cause leaks, and if the pointer graph is highly interconnected as happens with functional programs, then boom. In non-FP programs there's less risk but it's just not worth it I feel.