Android memory stack

I am writing an application in which there is a front-end service, a content provider, and an Activity external interface that communicates with the service and returns a list of objects using AIDL. The service really works and updates the database.

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

I believe there is a leak. When I check a bunch of memory, I get a heap size: ~ 18 MB, ~ 2 MB allocated, ~ 16 MB free. The hprof analysis in the Eclipse MAT seems fine, which makes me theorize that memory is stacking. Is it possible? If so, what can I do to stop or investigate the leak? Is the declared memory usage in the Android "Performed Services" section even correct (I suppose it is)?

Another note: I could not reproduce this problem when the user interface is not working (only with the service running)

+3
source share
1 answer

, , , Activity, AIDL.

, AIDL . , , - . , .

..., , . ?

. . , , , 42 .

, , ?

" " sans , , , . , , .

, , , . - .:-) , recycle() - .., , .

+1

Source: https://habr.com/ru/post/1744547/


All Articles