Loading ...
Sorry, an error occurred while loading the content.

Re: [pcgen_developers] android:largeHeap="true"

Expand Messages
  • Chris Dolan
    Another progress report. My latest work has all been on the Android app, not in the PCGen core code. I added a progress bar (it was really tedious waiting
    Message 1 of 2 , Feb 6, 2013
    • 0 Attachment
      Another progress report. My latest work has all been on the Android app, not in the PCGen core code. I added a progress bar (it was really tedious waiting blindly, or just reading LogCat messages) and an HTML rendering of the PC via ExportHandler, following the example of the CharacterSheetPanel but pushing the HTML to WebKit instead of lobobrowser. The webkit panel scrolls nicely via finger flicks, but it doesn't zoom via pinch or double-tap yet.

      As you can see from the progress bar in the screenshot, this is S-L-O-W on my Nexus 7 (over 16 minutes!). It's faster in the x86 Android emulator (3 minutes) but still glacial. Interestingly, it's pretty fast until the Dalvik VM hits ~60MB of heap, then it slows dramatically as Dalvik starts fighting to reclaim RAM. At that point Dalvik is spending more time in the GC than actually running code, I believe. If that analysis is correct, I either need to figure out how to tune the GC or resume my RAM-shrinking mission.

      I'm pleased that the HTML template just worked on Android with no code tweaking needed by me. Thank you all for writing such well-abstracted code.



      On Feb 3, 2013, at 10:36 AM, Chris Dolan <chris@...> wrote:

      Oh, man... I discovered something this weekend:

         android:largeHeap="true"

      This XML flag alerts Android 3.0+ that your app needs more RAM than the usual app. On the Nexus 7 (my initial target) this increases the max heap from 64m to 384m. On smaller platforms, like Android 4.0 phones, the cap is probably much smaller -- I need to research that.

      While all of the memory work I've been doing is definitely worthwhile I think, I'm annoyed that I missed this.

      It still takes 6 minutes(!) to load my sample Pathfinder PC (vs. 11 seconds on my desktop) but it finally works! The screenshot below is rather underwhelming in terms of UI, but it represents all of my backend work to date, including switching from CharacterFacade to PlayerCharacter by copying some logic out of CharacterManager. I haven't committed that change to github yet, but will later today.

    Your message has been successfully submitted and would be delivered to recipients shortly.