On Sep 9, 10:18 am, Peter Jeffe <[email protected]> wrote: > I should have said more clearly that in the case of these external > allocations it's acting like it can't grow the heap--i.e. there's a > hard limit that it hits against. Why is that the case? As many > threads on this subject for the last year have attested to, it's not a > question of hitting the overall heap limit, it's a question of the > external allocation failing due to some other limit that doesn't seem > to be flexible.
Something that can provide some insight here is to use "gclog.py" to watch the event log GC stats as your process executes. It lives in dalvik/tools but I don't think it's part of donut, so you can download a copy from http://bigflake.com/gclog.py.txt in the mean time. It dumps a few things from the GC stats for every process. The output looks like: 05-13 15:07:35 acore(2600) softlim=6464KB, extlim=2368KB, extalloc=2368KB freed 1024 objects / 46336 bytes in 138ms The second line will match up with what you see in the debug log. Here, 2600 is the process ID, and "acore" is a 5-character short form of the process name. All values come from 12-bit floating point numbers and so are approximate. Note you will see GC stats for *all* processes, so you may want to filter the output. If you see softlim+extlim approaching 16MB, you're about to have a problem. extlim and exalloc will give you a sense for how much memory is assigned to external allocations. The actual virtual heap limit used in the "can I allocate external memory" is based on the virtual heap's "footprint", which is dlmalloc's computation of how much memory is actually being used (includes heap overhead, fragmentation, and so on). That's sufficiently expensive to calculate that it's not actually output in the event log data by default, but the virtual heap soft limit is usually a fair approximation. Setting debug=True in handleGcInfo will add display the full set of stuff from the event log. Give this a shot and see what your app looks like as it runs. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

