Does the DalvikVM Garbage Collector halt the whole VM?

后端 未结 1 1790
逝去的感伤
逝去的感伤 2021-01-05 20:46

I have a situation in which an my Android application is not able to perform a soft real time task well in time as Garbage Collector is called which takes a few milliseconds

1条回答
  •  孤城傲影
    2021-01-05 21:06

    In Memory Management for Android Apps by Patrick Dubroy I found the following (slide 16, emphasis mine):

    • Pre-Gingerbread GC:

      • Stop-the-world

      • Full heap collection

      • Pause times often > 100ms

    • Gingerbread and beyond:

      • Concurrent (mostly)

      • Partial collections

      • Pause times usually < 5ms

    In general, garbage collection must stop the whole VM, although nowadays this time greatly reduced. However neither VM nor Android platform as a whole are not real-time operating systems so don't expect such strict guarantees.

    Why do you need single millisecond precision?

    0 讨论(0)
提交回复
热议问题