3 ms·
The LISP community went through this in the 1980s. They had to; the original Symbolics LISP machine had 45-minute garbage collections, as the GC fought with th
by Animats 11y ago
The LISP community went through this in the 1980s. They had to; the original Symbolics LISP machine had 45-minute garbage collections, as the GC fought with the virtual memory. There's a long list of tricks. This one is to write-protect data memory during the GC's marking phase, so marking and computation can proceed simultaneously. When the code stores into a write-protected page, the store is trapped and that pointer is logged for GC attention later. This works as long as the GC's marker is faster than the application's pointer changing. There are programs for which this approach is a lose. A large sort of a tree, where pointers are being retargeted with little computation between changes, is such a program.
If they're getting 3ms stalls on a 500MB heap, they're doing pretty well. That the stall time doesn't increase with heap size is impressive.
Re "avoid fragmentation to begin with by storing objects of the same size in the same memory span." That's easy today, because we have so much memory and address space. The simplest version of that is to allocate memory in units of powers of 2, with each MMU page containing only one size of block. The size round-up wastes memory, of course. But you can use any exponent in the range 1..2, and have, for example, block sizes every 20%. This approach is popular with conservative garbage collectors (ones that don't know what's a pointer and what's just data that looks like a pointer) because the size of a block can be determined from the pointer alone.
- nickpsecurity 11y agoYou thought of the LISP machines too, eh? Ill mark GC results under my meme: failure to learn from the past. One exception Azul Systems' Vega machines that have a hardware-assisted, concurrent, pauseless GC. What do you think of their approach? Worth emulating in a smaller, hardware project? Note: As usual, I'm thinking along lines of safer, processor design with possible GC. Needs to be a tad faster than i432. ;)
- lispm 11y agoSymbolics added an Ephemeral GC in 1985. It keeps a bitmap of modified memory pages with ephemeral objects in RAM. The Ephemeral GC then looked only at those pages. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.125.2438 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.125.... Macintosh Common Lisp later used a similar scheme on 68k machines with MMU.
- nickpsecurity 11y agoThanks for the link. This jumped out at me: "The importance of designing the architecture and the hardware to facilitate garbage collection is stressed." Replace GC with reliability, security, concurrency, and so on it's still true. It's why I advocated safe, high-level languages and RISC processors. I figured they'd be easier to modify at compiler or hardware level as people invented solutions to these problems. Doing the same on x86, Windows, and C++? I almost gave up...
- pjmlp 11y agoIn the mid-90's while at the university I got to learn about Oberon and eventually had the Native Oberon running on my PC. It opened my mind about using GC enabled systems programming languages. Eventually I became an Oberon addict and also Modula-3 one, as a side effect of discovering a book about it gathering dust in a technical library. OS vendors just need to care the same way as they do with improving JavaScript JIT compilers, for example.
- nickpsecurity 11y agoYeah it was pretty nice. The SPIN OS team wrote a whole OS in Modula-3 that supported safe, dynamic linking of code into the kernel for performance boosts. A recent discussion here showed that the Go language was partly an attempt to re-create one of its author's experience coding in Oberon. The combination of systems programming, safety, and productivity disappeared when he switched to C. Far as JS, that would help but it's a good example of why it won't. There were many attempts, like Juice [1], to replace JavaScript in the browsers with something better. There were also attempts to solve the problems at OS-level that Web solved. All of them ignored it to the point that we eventually got stuck with JavaScript & browsers being only thing that's on all devices with presentation & computation layer. So, while still ignoring better options, they continued to improve the speed of JavaScript engines and their new JIT schemes. So, the OS's could certainly benefit from the kind of activity that led to JavaScript JIT performance. However, their existence says more in the other direction. [1] http://www.modulaware.com/mdlt69.htm http://www.modulaware.com/mdlt69.htm