Tuesday, August 30, 2011

Re: [android-developers] handle byte memory here

On 30 August 2011 10:27, NaveenShrivastva <kumarnaveen.sinha@gmail.com> wrote:
> How to handle here byte array size.
> On Tue, Aug 30, 2011 at 1:00 PM, Naveen <kumarnaveen.sinha@gmail.com> wrote:
>> byte[] fullData = new byte[(int) filelen]; here it's byte array
>> integer type so facing outofmemory data is range of long size. byte
>> array not taking length long time default typecasting int

I am not sure whether I understand you fully, but why would you try to
create more than 2GB of array in memory?
It is a big ask even for a desktop machine. I don't think there is a
phone out there that has such amount of RAM available to the whole

For Dalvik VM having heap bigger than 16M could be tricky...

If you are trying to store more than say 4M in a byte array to use in
your mobile application, you are doing something wrong, and that's
what causes OutOfMemory, not the fact that you can't use numbers
bigger than the range of integers.

Daniel Drozdzewski

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
For more options, visit this group at

No comments:

Post a Comment