0

我在 android (3.2) 上运行 apache felix 和一个 osgi 应用程序。到目前为止,这工作得很好,但是我有相当大的数据块要加载到应用程序中(osgi 包)。问题在于,当我加载我得到的最大数据块时

LinearAlloc 超出容量

错误似乎来自

线性分配器

\#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 在 3.2/4.x 中甚至是 8*1024*1024,但我仍然达到了这个限制。我希望更好地了解导致此问题的原因以及如何解决此问题。任何帮助,将不胜感激。

4

1 回答 1

0

这是在异常复杂的接口层次结构上触发的 Dalvik 限制。

http://code.google.com/p/android/issues/detail?id=22586

有关解决方法的想法,请参阅详细信息。简单的答案可能是尝试使用不太复杂的不同库。

修复程序已合并到 Android AOSP。 https://android-review.googlesource.com/#/c/30900/

于 2012-03-20T11:26:44.080 回答