Android 应用程序(使用 felix)因 LinearAlloc 超出容量而崩溃

发布于 2024-12-22 01:08:41 字数 740 浏览 2 评论 0原文

我正在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤寂小茶 2024-12-29 01:08:41

这是 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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文