3meters / patchr-android

Patchr Android app
1 stars 0 forks source link

Memory footprint climbs over time and does not retreat #180

Closed Jaymassena closed 9 years ago

Jaymassena commented 9 years ago

Memory allocated slowly grows with activity. I would the expect the garbage collector to do a better job of reclaiming memory so there is a super good chance I have memory leaks and|or something that is slowly claiming more memory like a memory cache. Need to make sure we are leaking activity contexts because of anonymous inner instances of AsyncTask.

Jaymassena commented 9 years ago

Allocations to fix Convert AirImageView.onBitmapLoaded->fadeInMedium to use object animator.

Jaymassena commented 9 years ago

Notes after pounding the app with general use until alloc = 113.2MB, free = 8.8 after gc. Captured heap profile and loaded into eclipse memory analyzer.

Leak suspect 1: picasso.LruCache: 27.6MB Leak suspect 2: graphics.Bitmap: 32.5MB

Jaymassena commented 9 years ago

PlaceEdit activity is leaking because MapView is holding a reference to it.

Jaymassena commented 9 years ago

PlaceEdit, LocationPicker and PhotoForm were all leaking and have been fixed for v1.4.3.

Jaymassena commented 9 years ago

Also reduced the default size of the lrucache from ~25% to ~15%.

Jaymassena commented 9 years ago

After my latest work, I've confirmed using heap analysis that the app is not leaking any fragments or activities or contexts. Also, memory consumption by bitmaps looks pretty much as expected.