Post# 1577106528

23-Dec-2019 7:08 pm


[ Programming ]

Any GC should have three parts not two.

- Mark

  • Sweep
  • Compact.

    Without the compact step memory will get fragmented and long running processes will get slow.

    I wrote a mark/sweep GC. Felt it needed the compact part badly. How long might writing the compact part take? Thought 3 hours. Wasn't done by that time, thought maybe 30 hours. Then 30 hours passed.

    Now 26 days later, I finally am done with the "compact" part. No bug. How do I know? Cause a single bit of mistake deep down any part of the code caused the whole stack to crash, when running under huge load. Had to eliminate bugs one by one. Torturous amount of work. Like rewriting pointers on live stack and CPU registers after compact. And 700 lines of code later, it's done.

    The torture was worth it.

    23-Dec-2019 7:08 pm

  • Published
    23-Dec-2019