Stack memory in Android

Posted by Matt on Stack Overflow See other posts from Stack Overflow or by Matt
Published on 2010-05-07T18:32:55Z Indexed on 2010/05/07 18:38 UTC
Read the original article Hit count: 419

Filed under:
|
|
|

I'm writing an app that has a foreground service, content provider, and a Activity front end that binds to the service and gets back a List of objects using AIDL. The service does work and updates a database.

If I leave the activity open for 4-8+ hours, and go to the "Running Services" section under settings on the phone (Nexus One) an unusually large amount of memory being used is shown (~42MB).

I figure there is a leak. When I check the heap memory i get Heap size:~18MB, ~2MB allocated, ~16MB free. Analyzing the hprof in Eclipse MAT seems fine, which leads me to theorize that memory is leaking on the stack. Is this even possible? If it is, what can I do to stop or investigate the leak? Is the reported memory usage on the "Running Services" section of android even correct (I assume it is)?

Another note: I have been unable to reproduce this issue when the UI is not up (with only the service running)

© Stack Overflow or respective owner

Related posts about android

Related posts about stack