coslad Well-Known Member Licensed User Longtime User Jul 30, 2013 #1 Hi , I have a customlistview with only 15 items , each item have 3 label and 2 imageview , in some devices (not to all) when a load the CLV tha app crashs with OOM error. To load the bitmap i use : Code: immagine1.Bitmap=LoadBitmapSample(folder,appoggio,90,90) Now it is incredible this error, when the device have more the 400Mb of free ram . Please help me . Thanks
Hi , I have a customlistview with only 15 items , each item have 3 label and 2 imageview , in some devices (not to all) when a load the CLV tha app crashs with OOM error. To load the bitmap i use : Code: immagine1.Bitmap=LoadBitmapSample(folder,appoggio,90,90) Now it is incredible this error, when the device have more the 400Mb of free ram . Please help me . Thanks
thedesolatesoul Expert Licensed User Longtime User Jul 30, 2013 #2 Your app cannot use 400MB. Android restricts you to a lot lesser. There have been constant changes in the handling of bitmaps in the OS. Last I remember depending on the version your heap size is 64 MB. What OS are you testing on? What is the size of your bitmaps? Upvote 0
Your app cannot use 400MB. Android restricts you to a lot lesser. There have been constant changes in the handling of bitmaps in the OS. Last I remember depending on the version your heap size is 64 MB. What OS are you testing on? What is the size of your bitmaps?
Erel B4X founder Staff member Licensed User Longtime User Jul 31, 2013 #3 Note that you should use 90dip instead of 90. 15 images with that size should not consume too much memory. What is the size of the other images? Upvote 0
Note that you should use 90dip instead of 90. 15 images with that size should not consume too much memory. What is the size of the other images?
coslad Well-Known Member Licensed User Longtime User Jul 31, 2013 #4 The customlistview is not on the first activity but before to load the list i need to open 3 activity , and one of these have a sliding panel with many views . The image i load is attached , his dimension doesn't care becouse LoadBitmapSample redim it . The technical details of the device are : - 5.3 inch QHD screen, 960*540 pixel display - CPU: 1.2GHz MTK MT6589 quad-core, GPU: Power VR SGX544 - 1GB RAM + 4GB ROM This problem doesn't came out if the app run on a old Galaxy S - If i can trap the exception , i could not load the image on the device with low memory , otherwise i have to remove all the view before load that layout . what do you think? Attachments immagine.jpg 27.8 KB · Views: 670 Upvote 0
The customlistview is not on the first activity but before to load the list i need to open 3 activity , and one of these have a sliding panel with many views . The image i load is attached , his dimension doesn't care becouse LoadBitmapSample redim it . The technical details of the device are : - 5.3 inch QHD screen, 960*540 pixel display - CPU: 1.2GHz MTK MT6589 quad-core, GPU: Power VR SGX544 - 1GB RAM + 4GB ROM This problem doesn't came out if the app run on a old Galaxy S - If i can trap the exception , i could not load the image on the device with low memory , otherwise i have to remove all the view before load that layout . what do you think?
Erel B4X founder Staff member Licensed User Longtime User Jul 31, 2013 #5 Which version of B4A are you using? Starting from v2.7 the bitmap should be downsampled automatically if there isn't enough memory. Upvote 0
Which version of B4A are you using? Starting from v2.7 the bitmap should be downsampled automatically if there isn't enough memory.
coslad Well-Known Member Licensed User Longtime User Jul 31, 2013 #6 The version is 2.71 see the attach , i have attached a video that show you what appen , please watch it . the url of video is this : http://db.tt/HirpST5W Attachments versione.jpg 14.5 KB · Views: 615 Upvote 0
The version is 2.71 see the attach , i have attached a video that show you what appen , please watch it . the url of video is this : http://db.tt/HirpST5W
Erel B4X founder Staff member Licensed User Longtime User Aug 1, 2013 #7 Your process is out of memory. You should make sure that all bitmaps are loaded with LoadBitmapSample, the designer images are not larger than they need to be and that you are not loading unnecessary images. Upvote 0
Your process is out of memory. You should make sure that all bitmaps are loaded with LoadBitmapSample, the designer images are not larger than they need to be and that you are not loading unnecessary images.