Android 应用程序(使用 felix)因 LinearAlloc 超出容量而崩溃
我正在 android (3.2) 上运行 apache felix 和一个 osgi 应用程序。到目前为止,这工作得很好,但我有相当大的数据块要加载到应用程序(osgi 包)中。问题在于,当我加载最大的数据块时,我得到了
LinearAlloc 超出容量
该错误似乎来自
LinearAlloc.c,
\#define DEFAULT_MAX_LENGTH (4*1024*1024)
if (nextOffset > pHdr->mapLength) {
/*
* We don't have to abort here. We could fall back on the system
* malloc(), and have our "free" call figure out what to do. Only
* works if the users of these functions actually free everything
* they allocate.
*/
LOGE("LinearAlloc exceeded capacity, last=%d\n", (int) size);
dvmAbort();
}
据我所知,在3.2/4.x中它甚至是8*1024*1024,但我仍然达到了该限制。我希望更好地了解导致此问题的原因以及如何解决它。任何帮助将不胜感激。
I am running apache felix and an osgi app on android (3.2). This works pretty well so far, but I have rather large chunks of data to load into the application (osgi bundles). The problem with that is that when I load the biggest chunk of data I get
LinearAlloc exceeded capacity
The error seems to come from
LinearAlloc.c
\#define DEFAULT_MAX_LENGTH (4*1024*1024)
if (nextOffset > pHdr->mapLength) {
/*
* We don't have to abort here. We could fall back on the system
* malloc(), and have our "free" call figure out what to do. Only
* works if the users of these functions actually free everything
* they allocate.
*/
LOGE("LinearAlloc exceeded capacity, last=%d\n", (int) size);
dvmAbort();
}
afaik in 3.2/4.x it is even 8*1024*1024, but I still hit that limit. I'm looking to get better insight on what causes this problem and how I might possibly be able to fix it. Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 Dalvik 的一个限制,由异常复杂的接口层次结构触发。
http://code.google.com/p/android/issues/detail ?id=22586
请参阅有关解决方法的详细信息。简单的答案可能是尝试使用不太复杂的不同库。
修复已合并到 Android AOSP 中。
https://android-review.googlesource.com/#/c/30900/
It's a limitation in Dalvik triggered on unusually complex interface hierarchies.
http://code.google.com/p/android/issues/detail?id=22586
See the details for ideas on working around. Simple answer might be to try using different libraries that are less complex.
A fix has been merged into Android AOSP.
https://android-review.googlesource.com/#/c/30900/