Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: IdleGC – Idle-time garbage collection for Crystal (Reduce memory usage) (github.com/compumike)
2 points by compumike on Aug 31, 2022 | hide | past | favorite | 1 comment



IdleGC makes it easy to automatically run garbage collection when your Crystal process is otherwise idle. Idle-time garbage collection is beneficial for request-driven processes like API or web servers, because (1) it reduces the memory size of the program, reducing operating costs, and (2) it may prevent the garbage collector from running during a latency-sensitive period.

I've been using IdleGC in production on my previous Show HN project https://news.ycombinator.com/item?id=32081943 and it helps keeps memory usage low and consistent, which allows me to set tight Pod memory requests and limits and get more replicas running for higher concurrency on a single inexpensive Kubernetes node.

I know Chrome does "Idle Time Garbage Collection Scheduling" for V8 JavaScript [1]. Are there other systems, especially backends, that detect/guess when the system is idle, and do GC at that time?

[1] https://static.googleusercontent.com/media/research.google.c...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: