On Jun 24, 12:20 pm, Stefan <skyntc...@gmail.com> wrote:
> I am trying to track some excessive memory allocations in my
> application. For some reason the use of
> Debug.setAllocationLimit  or VMDebug.setAllocationLimit  appears to
> have no effect.

DroidDoc sayeth:

     * The feature may be disabled in the VM configuration.  If so,
this
     * call has no effect, and always returns -1.

You can tell whether or not it's enabled by running "adb shell
dalvikvm -help" and looking for the configuration line:

  Configured with: debugger profiler hprof extra_gc_checks
dalvik_assert show_exception=1

If "alloc_limits" doesn't appear, it's not enabled in the VM you're
running.  Because it has small but nonzero performance consequences,
and didn't actually get used for much internally, it's disabled by
default.

You'd need to enable WITH_ALLOC_LIMITS in dalvik/vm/Android.mk and
rebuild the VM before you can use it.

In any event, it's more useful for regression tests (e.g. you declare
that some piece of code doesn't allocate memory, and let the alloc
limit fire if that changes).  The "allocation tracker" in the stand-
alone DDMS is probably more useful, though you need to insert some
pause-points in your app to give you a chance to manually start/update
the tracker around a specific piece of code.

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

Reply via email to