Hacker Blogs
Work in progress: 15,409 of 181,233 sites checked so far, more every week · updated 2 Nov 2026Missing a blog? Tell us

Top all-time · #1818

H

Hans-J. Boehm

Personal blog · hboehm.infoprogrammingsystems

Hans-J. Boehm's personal blog at hboehm.info covers programming and systems. Since 2014, 43 different Hacker News readers have linked it 53 times, most often “A Garbage Collector for C and C++”. No feed was found, so read it on the site itself.

No feed foundVisit the blog
53mentions?
43HN people?
2014–2026first – last linked?
Links on Hacker News per year · peak 11 in 2015

Most-linked posts?

  1. A Garbage Collector for C and C++
    14 people · 14 mentions · first linked 2014-07-17
  2. gc: A garbage collector for C and C++
    9 people · 9 mentions · first linked 2019-07-06
  3. Boehm-Demers-Weiser conservative C/C++ Garbage Collector
    5 people · 6 mentions · first linked 2021-06-19

What Hacker News says?

  1. Solved by https://www.hboehm.info/new_crcalc/CRCalc.html Also, this is in the Android stock calculator so lifting the code over is easy. See also https://dl.acm.org/doi/10.1145/2911981

    Comment linking /new_crcalc/CRCalc.html

    on “2-in-1 calculator app adds up to surprise hit for retired engineer”
  2. Submitted Boehm-Demers-Weiser conservative C/C++ Garbage Collector as a story · 132 points

    HN discussion
  3. > second, because Objective-C does not require you to use dynamic dispatch if performance is a concern. No one is preventing you from doing plain-old C-style functions for performance criticial sections. That's just writing C, not Objective-C. But if we're going to go there, then neither does JavaScript. You can even use a C compiler if you like (Web Assembly/asm.js). > ARC reference counting on 64 bit iOS, as imple…

    Comment linking /gc/nonmoving/html/slide_11.html

    on “React Native for OS X”
  4. Submitted A Garbage Collector for C and C++ as a story · 88 points

    HN discussion
  5. https://www.hboehm.info/gc/ is a windows+linux+unix allocator implementation - it uses VirtualAlloc on Windows and mmap or sbrk on Unix. For performance reasons (avoiding a syscall) almost all malloc implementations only use sbrk / mmap occasionally and keep the malloc calls in userspace.

    Comment linking /gc/

    on “Can I use a system call?”
  6. Submitted A garbage collector for C and C++ as a story · 5 points

    HN discussion
  7. The Boehm collector ( http://www.hboehm.info/gc/ ) appears to offer what you're describing. In fact, it looks like it's what Crystal added in 2013 to implement its original garbage collection: https://crystal-lang.org/2013/12/05/garbage-collector.html

    Comment linking /gc/

    on “Crystal: Fast as C, Slick as Ruby”
  8. Submitted The Boehm-Demers-Weiser conservative garbage collector as a story · 4 points

    HN discussion
  9. This is known, but it's always possible to overcome these situations and its part of the language maturing. Golang has already had its run with optimizing their GC for real-time systems. Twitch uses Golang for their IRC chat, and they've taken the Golang GC on a journey which you can read about here: https://blog.twitch.tv/gos-march-to-low-latency-gc-a6fa96f06... Crystal will at some point also be forced to optimize…

    Comment linking /gc/

    on “Crystal: Fast as C, Slick as Ruby”
  10. Submitted A garbage collector for C and C++ as a story · 3 points

    HN discussion
  11. >One thing that I had not had time to do was to write a garbage collector. Cheat: use Hans Bhoem's conservative collector for C/C++: http://www.hboehm.info/gc/

    Comment linking /gc/

    on “Plan to throw one away”
  12. Submitted gc: A garbage collector for C and C++ as a story · 2 points

    HN discussion
  13. I'm not OP but the most popular C GC is Boehm's: https://www.hboehm.info/gc/

    Comment linking /gc/

    on “I stopped everything and started writing C again”
  14. > Whoa there! You mean “unspecified behavior”. int i = [unspecified] means that i has some value, but the spec doesn’t determine the value. Undefined behavior means that all your secrets might be sold to the highest bidder, your centrifuges might explode, and your computer is now full of ransomware. That's only when using Boehm GC[0] in kernel device drivers that self-modify. Or any MSVC binary. :-D 0 - https://www.…

    Comment linking /gc/

    on “So you think you know C? (2016)”
  15. You're one of today's lucky ten thousand! https://www.hboehm.info/gc/

    Comment linking /gc/

    on “The memory models that underlie programming languages (2016)”
  16. Basically C semantics are to blame, due to the way C was designed, and the liberties it allows its users, it is like programming in Assembly from a tracing GC point of view. Meaning that without any kind of metadata, the GC has to assume that any kind of value on the stack or global memory segments is a possible pointer, but it cannot be sure about it, it might be just a numeric value that looks like a valid pointer…

    Comment linking /gc/

    on “The Swift compiler is slow due to how types are inferred”
  17. > 1. No citation needed. I can take rust and do unsafe things in it. I can’t in a GC language. Rust allows you to use unsafe. That's not what you originally claimed though. You made some claims about 'risk of future unsafety' and I'm not sure what that means? For the second half of your claim, Rust's safety guarantees extend well past memory safety - and a collector doesn't guarantee memory safety at all. Yes, most…

    Comment linking /gc/

    on “Using Rust at a startup: A cautionary tale”
  18. > Conserative GCs leak. Yes, but usually the leak is bounded [0], although I'm not aware they evaluated real-world gaming engines. But I guess frame jitter is the bigger problem there. [0] https://www.hboehm.info/gc/bounds.html

    Comment linking /gc/bounds.html

    on “Using D to Create the World’s Fastest File System”
  19. The Boehm-Demers-Weiser garbage collecting memory allocation library. https://www.hboehm.info/gc/

    Comment linking /gc/

    on “Maxima in the browser using Embedded Common Lisp on WASM”
  20. The example in this blurb is a pretty good one: https://www.hboehm.info/c++mm/why_undef.html

    Comment linking /c++mm/why_undef.html

    on “Making memcpy(NULL, NULL, 0) well-defined”
  21. There's nothing inherently contradictory about running on bare metal, and being garbage collected. As long as you can manipulate memory directly, the garbage collector could potentially be implemented in the language itself. See the Boehm[1] GC as an example of a GC implemented in C for C/C++. [1]: https://www.hboehm.info/gc/

    Comment linking /gc/

    on “C# for Systems Programming”
  22. And note that you simply get a low-latency GC with libgc (Boehm-Weiser) by using the incremental GC with GC_enable_incremental() and SMP with parallel marking phases -DPARALLEL_MARK. http://www.hboehm.info/gc/scale.html This is no voodoo nobody ever managed to do, even if most blog posts for popular not-invented-here languages state the opposite. Of course libgc is pretty simple and slow, good for foreign code (i.e.…

    Comment linking /gc/scale.html

    on “Carp: a statically typed lisp, without a GC, for high performance applications”
  23. You could try using http://www.hboehm.info/gc/ An alternative is to do reference counting (in your prototyping phase), which is much easier to implement.

    Comment linking /gc/

    on “Simpler and faster GC for Go”
  24. Erlang is mostly an immutable functional language without pointers, so for most scenarios not involving large binaries, its GC is completely trivial. For large binaries, a relatively primitive reference counting system is used. If I were to study GC from scratch, I'd start with http://www.hboehm.info/gc/ .

    Comment linking /gc/

    on “Go 1.5 concurrent garbage collector pacing”
  25. > Web apps need: concatenation, substring, find/replace, maybe with regexps. All of those are implemented in C. join and gsub? http://benchmarksgame.alioth.debian.org/u64q/program.php?tes... > Web apps don't tend to implement entire trees in pure Ruby. Nor do other apps but that is what Hans Boehm came up with as a simple GC benchmark. http://hboehm.info/gc/gc_bench/ > What exactly are you getting at? You don't seem…

    Comment linking /gc/gc_bench/

    on “Scalability, but at what cost? (2015)”
  26. > There is a small computational cost to maintaining referenced pointers but it’s minuscule and the safety outweighs this cost. Atomic reference counting does not have minuscule costs. See, for example, http://www.hboehm.info/gc/nonmoving/html/slide_11.html In particular, note that if you use shared_ptr everywhere you will be end up with much slower code than you would have if you had a good GC. In other words, you…

    Comment linking /gc/nonmoving/html/slide_11.html

    on “Starting a tech startup with C++”
  27. > In no way is the Boehm GC that I'm aware of is generational or incremental Boehm disagrees: https://www.hboehm.info/gc/#details That thread isn't talking about the same thing, which it says no-one volunteered to write.

    Comment linking /gc/

    on “Commercial-Emacs”
  28. This is discussed now and then, but it's difficult to get all the architectural pieces to align to make it really work. A GC needs some kind of cooperation with the language, so you need to agree on common interfaces, which is a bit of a coordination problem. One of the goals of the now-defunct C-- project was to do that by providing a low-level target language for compilers, which also had a portable set of GC hook…

    Comment linking /gc/

    on “Building a lower-latency GC”
  29. These are two different questions: should C++ have a GC, and is a GC language suitable for systems programming. There is actually already a GC which works well with C++ and is also used by some of the mentioned languages: https://www.hboehm.info/gc/ . Personally I think the C++ specification is already far too big and complex (so why adding even more stuff). A lot of GC languages were more or less successfully used…

    Comment linking /gc/

    on “Project Oberon Emulator in JavaScript and Java”
  30. Ah, I stand corrected. (I had drawn my impression of Mono from https://en.wikipedia.org/wiki/Boehm_garbage_collector#Uses_a... 's current statement: "The Boehm GC is used by many projects that are implemented in C or C++, as well as by runtime environments for a number of other languages, including [...], the Mono implementation of the Microsoft .NET platform (also using precise compacting GC since version 2.8)"...…

    Comment linking /gc/

    on “RoboVM: Native iOS apps in Java”

Search all of HN for hboehm.info

Linked by the same people?