Unified stack for native and Java in Android Runtime (ART)

牧云@^-^@ 提交于 2020-01-02 11:06:26

问题


https://developer.android.com/guide/practices/verifying-apps-art.html#Stack_Size

This document says that the ART has a unified stack for native and Java. Could you tell me what does it mean? I understand that thread's stack-size can be defined only when it is created, e.g. using constructor of Thread class in Java code or pthread API in native code. So I can not understand how does unified stack affect behavior of applications. Please direct me to some good tutorials or snippet throws StackOverflowError resulted from unified stack.


回答1:


In Dalvik, each thread have a two separate stacks, one for the native code and for the Java code. In ART each thread have one stack for both native code and the Java code. If somewhere in your code (native or Java) you created a thread and specified it's stack-size, you should be aware now that this size is shared for both code environments, and you should adjust it accordingly.



来源:https://stackoverflow.com/questions/24885561/unified-stack-for-native-and-java-in-android-runtime-art

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!