Android NDK: Dalvik Heap and Native Heap - How Separate Between the two

前端 未结 3 1746
青春惊慌失措
青春惊慌失措 2021-02-04 05:45

I know there\'s Dalvik(JVM) heap and Native heap in an android platform. And the Dalvik GC has no work on native heap. But I\'m not sure how this work, I mean how the Android OS

3条回答
  •  萌比男神i
    2021-02-04 06:00

    Since Android is open source, you can check out the source code yourself. Looks like it calls create_mspace_with_base(). I'm not exactly sure what that does, but according to this post, it maps memory from /dev/zero.

    So it really is using a "separate" heap. It allocates its own memory pages directly and manages that itself.

提交回复
热议问题