Dalvik 栈空间大小

Dalvik had separate stacks for native and Java code, with a default Java stack size of 32KB and a default native stack size of 1MB.

java栈32KB,Native栈 1MB


如果线程的栈空间不足,报了StackOverflowError 错误。可以将设置更大的栈空间。

设置方式,注意Native 设置方法是在ART模式下:

  • In Java, review calls to the Thread constructor that specify an explicit stack size. For example, you will need to increase the size if StackOverflowError occurs.
  • In C/C++, review use of pthread_attr_setstack() and pthread_attr_setstacksize() for threads that also run Java code via JNI. Here is an example of the error logged when an app attempts to call JNIAttachCurrentThread() when the pthread size is too small:
    F/art: art/runtime/thread.cc:435]
        Attempt to attach a thread with a too-small stack (16384 bytes)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值