I have a widget that uses more memory than I would like.
In the service, I do cache images in an array for an animation, but then when I am finished with them, I loop through the array and set them all to "null". However, this action does not appear to have reduced the memory footprint. I would of hoped for the memory to drop down from this action. In the code its actually an array of a user type, where ".Image" is a Bitmap.
The widget is using about 35MB of ram. Although its not explicitly causing any issues, I just do not like this figure. Is there more I can do to clear the memory? or should I simply rely on the Android garbage collector to look after itself?
Does the memory have any effect on battery usage? On my phone, the battery usage does not show anything under 1%, and my widget does not show up in the list, so I guess its not an issue.
In the service, I do cache images in an array for an animation, but then when I am finished with them, I loop through the array and set them all to "null". However, this action does not appear to have reduced the memory footprint. I would of hoped for the memory to drop down from this action. In the code its actually an array of a user type, where ".Image" is a Bitmap.
B4X:
For i = 0 To ImageCache.Length - 1
ImageCache(i).Image = Null
ImageCache(i).IsValid = False
Next
Does the memory have any effect on battery usage? On my phone, the battery usage does not show anything under 1%, and my widget does not show up in the list, so I guess its not an issue.