Saturday, March 8, 2014
Solving, android4.0 memory overflow
1 found from the Internet android the maximum amount of memory the process is only 16M, I do not know android4.0 no change, or 16M it?
2 There is a page for pictures from the web based on the passed id, several times no problem, but if it is the big picture, or get more pictures, more than the number of requests, the memory overflow error, you do not know is how to solve this problem.<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Big picture needs to be scaled load http://www.cnblogs.com / wanqieddy/archive/2011/11/25/2263381.html
Memory very troublesome
Reply:
An appropriate reducing image sharpness
2, the currently displayed image on the screen recycle () away.
3, check there are no memory leaks (for example, some objects can not be recycled is always the case)
Personally, I think the most important thing is the second, we must promptly release the pictures do not show the percentage of memory.
Reply:
Appropriately scaled to reduce memory
Reply:
Thank you ls, according to the words you say have a new problem, if I want to see the big picture, you need to click on the thumbnail to show larger picture, and if the display is not open, you need to manually slide to view obscured this part, the possibility that the question came up, how to get the big picture as similar as the mask layer covering the original activity, but also added gesture events, do cause a memory leak big? (Personal feeling is very likely caused by a memory leak)
Reply:
1 to the maximum amount of memory an application using
determined by the ROM settings2 For multi-picture big picture solution to the Internet has a lot of pictures OOM Google Android has a lot under the reference scenario
For example BitmapFactory.Options weak reference in setting it to dynamically load pictures la la
3.
You say needs to be fully implementedFirst image representing memory size
when displaying thumbnails displayed by setting the reduced BitmapFactory.OptionsSecondly, when the zoom display only acquire, build, draw to be displayed Birmap part and reduce BitmapFactory.Options picture by setting the share of the display memory size
Third, when the zoom display again after the end of the drag action to acquire, build, draw Bitmap
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment