Is a garbage collector (.net/java) an issue for real-time systems?

前端 未结 7 1611
灰色年华
灰色年华 2021-02-01 03:19

When building a system which needs to respond very consistently and fast, is having a garbage collector a potential problem?

I remember horror stories from years ago whe

7条回答
  •  我在风中等你
    2021-02-01 03:51

    You bet it is a problem. If you are writing low-latency applications you cannot afford the stop-the-world pauses that most garbage collectors impose. Since Java does not allow you to turn off the GC, your only option is to produce no garbage. That can be done and has been done through object pooling and bootstrapping. I wrote a blog article where I talk about this in detail.

提交回复
热议问题