Author Topic: JPCT errors while trying to run app on Android Ice Cream 4.x  (Read 3772 times)

Offline K24A3

  • long
  • ***
  • Posts: 231
    • View Profile
Re: JPCT errors while trying to run app on Android Ice Cream 4.x
« Reply #15 on: January 11, 2012, 05:27:26 am »

Another option would be to use the DDMS tool to view the memory heap usage while the app is running. http://developer.android.com/resources/articles/track-mem.html

16MB is quite a lot for a basic scene with a skybox. My app has about 100 objects (some models have 4000+ vertices) with 15 decent sized textures amongst other things and the RAM usage is only 26MB.


Post up your code if you wish, we may be able to spot the problem.

Offline icarusfactor

  • int
  • **
  • Posts: 58
    • View Profile
Re: JPCT errors while trying to run app on Android Ice Cream 4.x
« Reply #16 on: January 11, 2012, 01:55:13 pm »
My problem with scale was rendering DNA structures with 10,000- 20,000 atoms and not counting bonds between each. Placing this data structure in a DB and reading only ones that are in visual range and trimming down further making touch active only ones that are close to viewer. Got to be a way to do it.  But had put this on the back burner until I could find a way to do it. DDMS is a good tool.

Offline K24A3

  • long
  • ***
  • Posts: 231
    • View Profile
Re: JPCT errors while trying to run app on Android Ice Cream 4.x
« Reply #17 on: January 12, 2012, 11:10:45 am »
Ah that's what is using so much memory, I thought you had just a basic 3D scene.

I had the same issue when I jumped from Gingerbread to Honeycomb, the RAM usage was almost double and could not figure out why. I'm assuming it's the result of Android taking advantage of the larger RAM sizes in newer devices to minimize GC pauses.

There is a simple solution but you will need to have separate APK's for 2.x and ICS.
Honeycomb introduced the large heap parameter in the AndroidManifest.xml file which increases the application RAM from the usual 16GB/24GB/32GB size to 256MB.

Add android:largeHeap="true" to this tag:
<application android:icon="@drawable/icon" android:largeHeap="true" android:label="@string/app_name" android:debuggable="false">

Also ensure the minimum SDK is set to 11 if you want Honeycomb support, or 14 for just ICS support.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11746
    • View Profile
    • http://www.jpct.net
Re: JPCT errors while trying to run app on Android Ice Cream 4.x
« Reply #18 on: January 12, 2012, 11:23:52 am »
...but it's not guaranteed that this parameter actually does anything on a specific platform. I wouldn't rely on it...

Offline K24A3

  • long
  • ***
  • Posts: 231
    • View Profile
Re: JPCT errors while trying to run app on Android Ice Cream 4.x
« Reply #19 on: January 12, 2012, 12:22:26 pm »
That's true, 256MB is what I get on a Tegra2 3.2 Tablet with 1GB RAM. If it's a 'no-name' Tablet with say only 512MB total RAM then I wouldn't expect much of an increase.

Offline icarusfactor

  • int
  • **
  • Posts: 58
    • View Profile
Re: JPCT errors while trying to run app on Android Ice Cream 4.x
« Reply #20 on: January 13, 2012, 01:47:16 am »
That is a really good tip. Yes I thought it was no larger than 32m.
256m is a big plus. But to make it scalable the Android Database
gives me 2 gig of space, well within the limits I need for a structure.
But also understand if to do that, it would be best for making two
 versions.