D DT1111 Member Licensed User Longtime User Jan 19, 2016 #1 Are there any known trade-offs when the heap memory is increased? Does it have impact on computational or overall app speed, etc? Just curious. Code: SetApplicationAttribute(android:largeHeap,"true") Thanks.
Are there any known trade-offs when the heap memory is increased? Does it have impact on computational or overall app speed, etc? Just curious. Code: SetApplicationAttribute(android:largeHeap,"true") Thanks.
R Roycefer Well-Known Member Licensed User Longtime User Jan 19, 2016 #2 I don't think there's any effect on app speed, though this is something you could easily test to your own satisfaction. As for other trade offs, there's a chance an app with a largeHeap will be selected earlier by the OS for killing if the OS needs the RAM for something else. Upvote 0
I don't think there's any effect on app speed, though this is something you could easily test to your own satisfaction. As for other trade offs, there's a chance an app with a largeHeap will be selected earlier by the OS for killing if the OS needs the RAM for something else.
Informatix Expert Licensed User Longtime User Jan 19, 2016 #3 DT1111 said: Are there any known trade-offs when the heap memory is increased? Does it have impact on computational or overall app speed, etc? Just curious. Code: SetApplicationAttribute(android:largeHeap,"true") Thanks. Click to expand... Theoretically, there's an impact on performance. As Google says: Using the extra memory will increasingly be to the detriment of the overall user experience because garbage collection will take longer and system performance may be slower when task switching or performing other common operations. Click to expand... Upvote 0
DT1111 said: Are there any known trade-offs when the heap memory is increased? Does it have impact on computational or overall app speed, etc? Just curious. Code: SetApplicationAttribute(android:largeHeap,"true") Thanks. Click to expand... Theoretically, there's an impact on performance. As Google says: Using the extra memory will increasingly be to the detriment of the overall user experience because garbage collection will take longer and system performance may be slower when task switching or performing other common operations. Click to expand...
D DT1111 Member Licensed User Longtime User Jan 22, 2016 #4 Thanks both for your inputs. Is it possible to have a conditional activating of heap memory in the manifest. When my app which is “bitmap intensive” runs on a large screen e.g FHD screen via an Android box, it will crash with an out of memory exception. That has been solved by activating the heap memory ie I have no choice even if the heap memory has some detrimental effect on the system. But when the app runs on little tablets eg 10", the out of memory exception never occurs. So I think it is better to deactivate the heap memory. In other words If run on large screen then activate heap memory else deactivate heap memory Is that possible in the manifest file? Thanks. Upvote 0
Thanks both for your inputs. Is it possible to have a conditional activating of heap memory in the manifest. When my app which is “bitmap intensive” runs on a large screen e.g FHD screen via an Android box, it will crash with an out of memory exception. That has been solved by activating the heap memory ie I have no choice even if the heap memory has some detrimental effect on the system. But when the app runs on little tablets eg 10", the out of memory exception never occurs. So I think it is better to deactivate the heap memory. In other words If run on large screen then activate heap memory else deactivate heap memory Is that possible in the manifest file? Thanks.
Informatix Expert Licensed User Longtime User Jan 22, 2016 #5 You have to create a configuration file. First, you replace the boolean value by a variable in your manifest: SetApplicationAttribute(android:largeHeap,"@bool/largeheap") Then you create a config file (its name doesn't matter) that contains true or false and you put it in the folder corresponding to the targeted screen. For example in objects/res/drawable-xhdpi or objects/res/layout-xlarge (see this doc for further details). <?xml version="1.0" encoding="utf-8"?> <resources> <bool name="largeheap">true</bool> </resources> Upvote 0
You have to create a configuration file. First, you replace the boolean value by a variable in your manifest: SetApplicationAttribute(android:largeHeap,"@bool/largeheap") Then you create a config file (its name doesn't matter) that contains true or false and you put it in the folder corresponding to the targeted screen. For example in objects/res/drawable-xhdpi or objects/res/layout-xlarge (see this doc for further details). <?xml version="1.0" encoding="utf-8"?> <resources> <bool name="largeheap">true</bool> </resources>
D DT1111 Member Licensed User Longtime User Jan 23, 2016 #6 Thanks Informatix for your very helpful pointers. Upvote 0