Java has no architected heap limit.  I've seen applications that use
several GB of heap.

Any heap limits are purely a result of the specific implementation.

On Feb 25, 10:31 am, spaceraiders <spaceraid...@gmail.com> wrote:
> After writing Java apps for a while and being mindful of the heap
> memory limit (typically 16Mb or 24Mb), I was surprised to discover
> recently that NDK apps have no limit on how much memory they can
> allocate. I have a few queries:
>
> 1. Why was the decision made to not enforce the same limitations on
> NDK code?
>
> 2. What are the implications of rewriting apps that use the NDK to
> allocate, say, double the regular Java heap limit? I've done some
> experiments and e.g. using 40Mb on a phone with 256Mb RAM and a Java
> heap limit of 24Mb doesn't seem to cause any noticeable problems.
> Background apps start getting killed when you use a lot more memory
> though.
>
> 3. Are there any plans to increase the Java heap limit? Seeing as
> phones are now getting >=512Mb RAM, giving less than 10% of this to
> the foreground app seems an odd limitation.
>
> I've noticed apps on the market that say they require 256Mb RAM to run
> (!) so other developers are definitely taking advantage of the NDK in
> this way. I much prefer coding in Java but the memory limit makes
> certain apps very tough to write so sticking to Java makes it hard to
> compete with developers that use the NDK.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to