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

前端 未结 7 1405
灰色年华
灰色年华 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 04:02

    It is a potential problem, BUT...

    Your character might also freeze in the middle of your C++ program while the OS retrieves a page of memory from an overtaxed hard disk. If you are not using a real-time OS on hardware designed to provide concrete performance guarantees, you are never guaranteed performance.

    To get a more specific answer, you'd have to ask about a specific implementation of a specific virtual machine. You can use a garbage-collected virtual machine for real-time systems if it provides suitable performance guarantees about garbage collection.

提交回复
热议问题