On May 6, 6:06 am, vishal bhoj <
vishalb...@gmail.com> wrote:
> Why is the reason for limiting the memory heap to 16 MB. Is it possible to
> change the limitation of memory heap of application from 16M to 32 M. What
> would be the repercussion of increasing the Heap size.
This is done, effectively as a platform configuration, as one of
several compromises in the platform aimed to allow for a reasonable
number of simultaneous processes to be active at any given time, given
the amount of system RAM typically available in an incarnation of the
platform.
As Magnus correctly indicated, this can be changed as part of platform
configuration. However, it can't be set on a per-app basis, since that
would inevitably lead to a kind of war of "required RAM escalation,"
ultimately ending up with many apps requesting RAM sizes that are
simply inappropriate for the device they are running on, leading to a
poor end-user experience.
This is similar to the cpu priority issue that was discussed a month
or so ago. In particular, the Android philosophy is to try to balance
capabilities provided to apps against end-user desires, where a
baseline desire is taken to be that the user wishes to have a device
that is responsive and doesn't crash. You might be able to argue for
an adjustment in policy details — e.g., maybe it should be 20 megs —
but I don't think you will make much headway arguing against the
philosophy.
And with respect to the details, over time, as Android-based devices
gain more RAM in their typical incarnations, you can expect this limit
to be raised in the default configuration of the platform.
If you have an application that requires more than 16 megs today, then
it probably isn't suitable for wide deployment to Android-based
devices in general, right now. However, if you are building your own
custom platform (e.g., deploying your app as part of a vertical
solution that also includes the entire OS), then you can of course
tweak the platform to your heart's content.
-dan