macocio
2018-11-22 13:54:38

does racket have a realtime gc?


mark.warren
2018-11-22 14:31:07

@macocio I must admit I don’t know anything about GC in racket but the racket documentation has a section on memory management which says, The Racket implementation is available in three variants: 3m, CGC, and CS. The 3m and CS variants use a modern, generational garbage collector that makes allocation relatively cheap for short-lived objects. The CGC variant uses a conservative garbage collector which facilitates interaction with C code at the expense of both precision and speed for Racket memory management. The 3m variant is currently the standard one.

That’s in the Racket Guide (Section 19.11) https://docs.racket-lang.org/guide/performance.html

I don’t know if that helps.


samth
2018-11-22 14:53:34

@macocio what people mean by real-time gc varies, but the regular collector can be incremental which is often what you need for games for example


macocio
2018-11-22 15:04:19

@samth I’ve had it on using (collect-garbage 'incremental) but it still has noticeable pauses of >200 ms


macocio
2018-11-22 15:04:46

Also, repeatedly calling that with glfw causes slowdown and eventually a crash due to some mmap stuff (at work, dont have logs)


samth
2018-11-22 15:14:33

Are those the incremental pauses?


samth
2018-11-22 15:14:43

Or are you still seeing major collections


macocio
2018-11-22 15:15:41

I’m not sure, I’ll have to turn on gc logging and I’ll check


macocio
2018-11-22 17:40:45

@samth, yup, MAJ events still happen :open_mouth:


macocio
2018-11-22 17:41:58
GC: 0:MAJ @ 234,450K[+66,438K](+12,460K); free 44,135K[-43,063K] 101ms @ 9273
GC: 0:MAJ @ 198,506K[+101,310K](+12,456K); free 12,155K[+5,838K] 293ms @ 9387
... (some time later)
mprotect failed: 7f705ccf8000, 16384, 1, 12
Aborted (core dumped)