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


\#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);

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.


It's a limitation in Dalvik triggered on unusually complex interface hierarchies.

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.

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', ''], ['Demo-Site', ''],

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.