Android app (with felix) crashes with LinearAlloc exceeded capacity

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.

Answers


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/


Need Your Help

Liferay CSRF protection with @ResourceMapping

liferay csrf liferay-6 csrf-protection

I need to add CSRF token (p_auth) to my Liferay (ver.6.1.1) portal project.

String building in python from lists

python list

[['Demo-Site', '10.227.209.139'], ['Demo-Site', '10.227.215.68'],

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.