Dalvik heap size limit

Showing 1-9 of 9 messages
Dalvik heap size limit Matt Moohyun Shin 12/8/10 12:36 AM
Hi,
I'd like talk about the heap size limit by dalvik.vm.heapsize system
property.
basically it is a absolute max value related to out-of-mem exception
if an application request more than that.
the question here is why do we set small value like 16 or 24MB ? what
happens if we simply increase to 64MB?
As Dalvik has it's internal soft limit that leads to GC, there is no
waste of heap memory!
Of course there could be an application that utilizes 'soft reference'
as much as Dalvik permits.
But as far as i know, that case is negligible and it is better to
avoid application crash by OOM exception.
What do you think about this?
Re: Dalvik heap size limit Jean-Baptiste Queru 12/8/10 8:17 AM
That would cause different devices to behave differently for the same
app, which is not desirable if there are no other differences between
those devices that would cause apps to need different amounts of
memory.

JBQ

> --
> You received this message because you are subscribed to the Google Groups "android-platform" group.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
>
>

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

Re: Dalvik heap size limit Romain Guy 12/8/10 9:29 AM
Increasing the maximum heap size would also increase garbage collection times and you would have fewer apps resident in memory at the same time, thus making app switching potentially slower.Romain Guy
Android framework engineer
roma...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support.  All such questions should be posted on public forums, where I and others can see and answer them
Re: Dalvik heap size limit Matt Moohyun Shin 12/9/10 9:15 PM
hmm.. I don't quite understand why garbage collection times increase.
Normal GC not claiming soft references will be done even before
reaching the maximum heap size.
As I mentioned before, the target heap or ideal heap size will be used
to determine when to do GC.
and the last time GC (before OOM crash) claims soft references, but
this behavior doesn't seem to increase GC times.
Would you please let me know a bit more details?
Thanks!

On 12월9일, 오전2시29분, Romain Guy <romain...@android.com> wrote:
> Increasing the maximum heap size would also increase garbage collection
> times and you would have fewer apps resident in memory at the same time,
> thus making app switching potentially slower.
>
>
>
>
>
>
>
>
>
> On Wed, Dec 8, 2010 at 8:17 AM, Jean-Baptiste Queru <j...@android.com> wrote:
> > That would cause different devices to behave differently for the same
> > app, which is not desirable if there are no other differences between
> > those devices that would cause apps to need different amounts of
> > memory.
>
> > JBQ
>
> > On Wed, Dec 8, 2010 at 12:36 AM, Matt Shin <matt.s...@gmail.com> wrote:
> > > Hi,
> > > I'd like talk about the heap size limit by dalvik.vm.heapsize system
> > > property.
> > > basically it is a absolute max value related to out-of-mem exception
> > > if an application request more than that.
> > > the question here is why do we set small value like 16 or 24MB ? what
> > > happens if we simply increase to 64MB?
> > > As Dalvik has it's internal soft limit that leads to GC, there is no
> > > waste of heap memory!
> > > Of course there could be an application that utilizes 'soft reference'
> > > as much as Dalvik permits.
> > > But as far as i know, that case is negligible and it is better to
> > > avoid application crash by OOM exception.
> > > What do you think about this?
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "android-platform" group.
> > > To post to this group, send email to android-...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > android-platfo...@googlegroups.com<android-platform%2Bunsubscrib e...@googlegroups.com>
> > .
> > > For more options, visit this group at
> >http://groups.google.com/group/android-platform?hl=en.
>
> > --
> > Jean-Baptiste M. "JBQ" Queru
> > Software Engineer, Android Open-Source Project, Google.
>
> > Questions sent directly to me that have no reason for being private
> > will likely get ignored or forwarded to a public forum with no further
> > warning.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > android-platfo...@googlegroups.com<android-platform%2Bunsubscrib e...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/android-platform?hl=en.
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
Re: Dalvik heap size limit Matt Moohyun Shin 12/9/10 9:19 PM
If different heap sizes cause different behaviors, what about
increasing the default value?

On 12월9일, 오전1시17분, Jean-Baptiste Queru <j...@android.com> wrote:
> That would cause different devices to behave differently for the same
> app, which is not desirable if there are no other differences between
> those devices that would cause apps to need different amounts of
> memory.
>
> JBQ
>
>
>
>
>
>
>
>
>
> On Wed, Dec 8, 2010 at 12:36 AM, Matt Shin <matt.s...@gmail.com> wrote:
> > Hi,
> > I'd like talk about the heap size limit by dalvik.vm.heapsize system
> > property.
> > basically it is a absolute max value related to out-of-mem exception
> > if an application request more than that.
> > the question here is why do we set small value like 16 or 24MB ? what
> > happens if we simply increase to 64MB?
> > As Dalvik has it's internal soft limit that leads to GC, there is no
> > waste of heap memory!
> > Of course there could be an application that utilizes 'soft reference'
> > as much as Dalvik permits.
> > But as far as i know, that case is negligible and it is better to
> > avoid application crash by OOM exception.
> > What do you think about this?
>
> > --
> > You received this message because you are subscribed to the Google Groups "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/android-platform?hl=en.
Re: Dalvik heap size limit fadden 12/10/10 12:35 PM
On Dec 9, 9:15 pm, Matt Shin <matt.s...@gmail.com> wrote:
> hmm.. I don't quite understand why garbage collection times increase.

The point of having a larger heap is to have more stuff in memory.  If
you have 2x as many objects, it takes 2x as long to scan them.  (It's
not quite that simple, but you get the idea.)
Re: Dalvik heap size limit Matt Moohyun Shin 12/13/10 1:50 AM
thanks, Fadden.
I thought it was about how many times GC is performed regardless of
total amount of time spent. :)
And i absolutely agree that it is not that simple in terms of
efficiency and/or performance.

Anyway, my point was...
are there any possibilities that larger maximum heap configuration
will take more heap memory?
For instance, the calculator application is a very small application
which consumes much lesser heap than the maximum.
In other words, it never reach the maximum heap whatever we do !
In this case, increasing maximum heap limit will also increase the
amount of memory taken by the calculator application?
Thanks in advance for your time.

-- Matt
Re: Dalvik heap size limit Dianne Hackborn 12/13/10 10:02 AM
On Mon, Dec 13, 2010 at 1:50 AM, Matt Shin <matt...@gmail.com> wrote:
In this case, increasing maximum heap limit will also increase the
amount of memory taken by the calculator application?

No it won't.  The max heap size is already well above the amount Calculator needs, and Calculator doesn't grow to that size because it doesn't need it.

--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Re: Dalvik heap size limit James 12/13/10 6:33 PM
Long time no see :-)

On Dec 8, 11:17 am, Jean-Baptiste Queru <j...@android.com> wrote:
> That would cause different devices to behave differently for the same
> app, which is not desirable if there are no other differences between
> those devices that would cause apps to need different amounts of
> memory.
>
> JBQ
>
>
>
> - Hide quoted text -
>
> - Show quoted text -
>
>
>
> On Wed, Dec 8, 2010 at 12:36 AM, Matt Shin <matt.s...@gmail.com> wrote:
> > Hi,
> > I'd like talk about the heap size limit by dalvik.vm.heapsize system
> > property.
> > basically it is a absolute max value related to out-of-mem exception
> > if an application request more than that.
> > the question here is why do we set small value like 16 or 24MB ? what
> > happens if we simply increase to 64MB?
> > As Dalvik has it's internal soft limit that leads to GC, there is no
> > waste of heap memory!
> > Of course there could be an application that utilizes 'soft reference'
> > as much as Dalvik permits.
> > But as far as i know, that case is negligible and it is better to
> > avoid application crash by OOM exception.
> > What do you think about this?
>
> > --
> > You received this message because you are subscribed to the Google Groups "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/android-platform?hl=en.