Forums - Android NDK app memory

2 posts / 0 new
Last post
Android NDK app memory
Slidexx01
Join Date: 14 Jan 14
Posts: 1
Posted: Sat, 2015-10-24 05:16

Hello

I just wonder why I cannot allocate any more memory when reaching 1GB of RAM on a device with 2GB of RAM.

The app is very computation intesive and it is developed using Android NDK r9 and tested on Samsung Note 3.

I must point out that before running my app there is about 1.6GB free of RAM, so there is enough memory to allocate more than 1GB.

Then I start allocating memory by loading objects in to my app using dlmalloc(). When reaching 1GB of memory dlmalloc fails as if it reached maximum heap memory, or address space and the app crashes of course.

So can anybody share some knowledege about this. Is there maybe a heap size limit for each process/app?? Where or how can I check these limits?? I know about Java Virtual machine limits 25 or 50 MB or somtimes 250 MB, and I do not think this is an issues, as I work in native code (NDK)

Thank you in advance

  • Up0
  • Down0
carrado.grant@g...
Join Date: 20 Sep 12
Posts: 38
Posted: Thu, 2016-01-07 17:27

I"m  somewhat confused about your apps behavior. Being computational intensive does NOT translate directly into being memory intensive. If you have to crunch that much data in a single frame or invocation of whatever computational processes you are doing, then you are on the wrong device. Also, using the NDK does not get rid of the JVM as if you application is most likely a NativeActivity which has boiler plate Java code to allow your application to run. So your app still have to play by the JVM rule. I would suggest revisting your approach as your, unless your app is the only application resident in memory on the device and the OS doesn't require any memory to run.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.