Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Triggering the garbage collection
Fri, Aug 23 2013 3:58 AMPermanent Link

Matthew Jones

How can I trigger a garbage collection in my app? I've been running my app
overnight on an android phone using phonegap and it was very sluggish. Running it
in Chrome shows that it does a garbage collection after about 4 minutes, and is
using about 7MB of memory. I don't know how often Android garbage collects, but I'd
really like to be able to kick one off in my code so I can optimise it.

Anyone know?

/Matthew Jones/
Fri, Aug 23 2013 6:55 AMPermanent Link

Matthew Jones

Okay, I know now. You cannot trigger a garbage collector, it will do it itself,
according to the platform. Unfortunately, my code seems to have a serious slow-down
on Android after running for a few hours, and I can't work out why. Oddly, on the
cheap v2.3 phone it stays responsive but it is on the Galaxy Nexus and Nexus 7
(original) that it shows the symptoms, and in the emulator too. Digging...

/Matthew Jones/
Image