B buras3 Active Member Licensed User Longtime User Dec 31, 2014 #1 hey my bug is java.lang.OutOfMemoryError: bitmap size exceeds VM budget(Heap Size=18695KB, Allocated=14308KB, Bitmap Size=11730KB) in android >3 it's ok but in my other device i get this error in Code: 'Converts a bytes array to an image (for BLOB fields). Public Sub BytesToImage(bytes() As Byte) As Bitmap Dim In As InputStream In.InitializeFromBytesArray(bytes, 0, bytes.Length) Dim bmp As Bitmap bmp.Initialize2(In ) Return bmp End Sub my questions are: 1 is the size is too big - am i doing something wrong? the bmp is 2-3 mega not 11 mega 2 can i get the heap size and Allocated for the device and reduce the bytes array ? the only solution for now is to reduce the bmp before upload - but then the quality is not good tank you all
hey my bug is java.lang.OutOfMemoryError: bitmap size exceeds VM budget(Heap Size=18695KB, Allocated=14308KB, Bitmap Size=11730KB) in android >3 it's ok but in my other device i get this error in Code: 'Converts a bytes array to an image (for BLOB fields). Public Sub BytesToImage(bytes() As Byte) As Bitmap Dim In As InputStream In.InitializeFromBytesArray(bytes, 0, bytes.Length) Dim bmp As Bitmap bmp.Initialize2(In ) Return bmp End Sub my questions are: 1 is the size is too big - am i doing something wrong? the bmp is 2-3 mega not 11 mega 2 can i get the heap size and Allocated for the device and reduce the bytes array ? the only solution for now is to reduce the bmp before upload - but then the quality is not good tank you all
B buras3 Active Member Licensed User Longtime User Dec 31, 2014 #2 No need to answer problem fixed Upvote 0
KMatle Expert Licensed User Longtime User Dec 31, 2014 #3 @buras3 : Would you please post the solution? It's always better to post how it was solved. Upvote 0
B buras3 Active Member Licensed User Longtime User Dec 31, 2014 #4 Sure, usually I do. I was using service with reqManager to download Images from sql server - "select * from PicTable" (about 10 images) I Changed to "select * from PicTable where PicId=?" and downloaded the images one at the time the idea came from one of Erel posts - that the memory will be free when the object is released Last edited: Dec 31, 2014 Upvote 0
Sure, usually I do. I was using service with reqManager to download Images from sql server - "select * from PicTable" (about 10 images) I Changed to "select * from PicTable where PicId=?" and downloaded the images one at the time the idea came from one of Erel posts - that the memory will be free when the object is released