I'd expect that native-initiated applications wouldn't be subject to a
16MB limit, and that going over budget would result in the app getting
killed, but I'm definitely not an expert (and I've never used the
NDK). You would probably get some more detailed information on the
android-ndk list.

JBQ

On Mon, Aug 17, 2009 at 9:18 AM, niko20<[email protected]> wrote:
>
>
>
> On Aug 17, 11:04 am, Jean-Baptiste Queru <[email protected]> wrote:
>> Have you tried using the NDK?
>>
>> (Note: there's no way you'll be able to use 100MB of RAM on a G1 given
>> that there's barely that much RAM available to the kernel before it
>> even starts - you might be able to get to about 30MB, but at the point
>> you'll be hurting the system and it risks defending itself by killing
>> your app).
>>
>> (Note2: the 16MB limit isn't enforced by the system, it's literally
>> each process restricting itself to avoid getting into a situation
>> where they'd risk getting killed).
>>
>> JBQ
>>
>>
>>
>> On Mon, Aug 17, 2009 at 8:53 AM, niko20<[email protected]> wrote:
>>
>> > Hi Guys.
>>
>> > I actually have another issue that I think is important as well. Even
>> > IF the phone got more internal memory so you could use bigger
>> > programs, another difference from the "iphone" is that on android an
>> > App can only use 16MB heap space. This is actually quite a limitation
>> > if you are doing some fancy program to process audio or data streams.
>>
>> > Of course there are ways around such a limit (using sdcard to
>> > temporarily store data, memory swapping in effect), but as an example
>> > I point you to an iphone app called BeatMaker, which is a music making
>> > app on the iphone. It loads WAV files and allows you to sequence them
>> > (my Electrum Drum II program is a basic version of this capabililty).
>>
>> > BeatMaker software on the iphone can load up to 35MB of samples, and
>> > in the next version they will allow up to 100MB of samples.
>>
>> > Now obviously this program is just faster anyway being that it's not
>> > written in Java, so they could probably dynamically load data much
>> > quicker, but I don't think the iphone OS has any heap limitations
>> > except for max memory in the device.
>>
>> > So really to compare android to the iphone OS is really never a good
>> > thing to do, they will never be equivalent. 16MB of heap yes, is a lot
>> > compared to most phone apps requirements, but if you compare it to
>> > what a app COULD do - well it can become another limitation.
>>
>> > So I guess what I'm saying is we need to stop comparing android to the
>> > iphone. Unfortuantely I think most users WILL do so, and they will be
>> > like, "hey, why can't you make the program do XXXX? They can do it on
>> > the iphone", and then we are left holding the back to try to explain
>> > the technical details and of course they don't understand those.
>>
>> > It's really another one of the "frustrations" we will just have to put
>> > up with. Face it some apps just can't be done on android, period.
>>
>> > -niko
>>
>> --
>> Jean-Baptiste M. "JBQ" Queru
>> Software Engineer, Android Open-Source Project, Google.
>>
>> Questions sent directly to me that have no reason for being private
>> will likely get ignored or forwarded to a public forum with no further
>> warning.
>
>
>
> Hi,
>
> Actually I am using the NDK for some audio resampling, and it works
> very well. However yes if I get to about 16MB of samples loaded, I
> will get out of memory errors, but this may just be some other problem
> and just a coincidence?
>
> Anyway, are you saying using the NDK to allocate new buffers, or to
> read the file data itself? I haven't yet investigated either just yet.
> Probably would go much faster to read the file in the NDK tho since I
> need to swap big-little endian when I read it since Java used Big
> Endian but WAV's are little endian format.
>
> -niko
>
> >
>



-- 
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to