Eclipse & "Native Heap" tab in DDMS

1,778 views
Skip to first unread message

Mike Edenfield

unread,
Feb 28, 2011, 4:27:58 PM2/28/11
to andro...@googlegroups.com
I need to debug some memory leak problems in my native code, so I'm
trying to turn on the Native Heap tab in the DDMS tool. I can get the
tab to appear when running DDMS from a command line (by editing
ddms.cfg), but not when running inside Eclipse. However, I need to be
stepping through my code via Eclipse while monitoring memory use, and I
can't get both to run at the same time.

Is there a way to do either of these things:

1. Enable the Native Heap tab inside Eclipse's DDMS plug-in?

2. Disconnect Eclipse's DDMS plug-in from the debugger so the standalone
DDMS can attach?

--Mike

fadden

unread,
Mar 1, 2011, 4:24:28 PM3/1/11
to android-ndk
On Feb 28, 1:27 pm, Mike Edenfield <kut...@kutulu.org> wrote:
> Is there a way to do either of these things:
>
> 1. Enable the Native Heap tab inside Eclipse's DDMS plug-in?
>
> 2. Disconnect Eclipse's DDMS plug-in from the debugger so the standalone
> DDMS can attach?

I don't know of a way to block DDMS. Other possibilities include (a)
temporarily uninstall the ADT plugin, and (b) close Eclipse and use a
different debugger (like jswat or jdb) to do the single-stepping.

BTW, if the "native" tab seems to be missing information, resizing the
sub-window to force a redraw seems to help. (The feature is disabled
by default for a reason...)

Weeds

unread,
Mar 3, 2011, 9:20:13 PM3/3/11
to android-ndk
On 28 Feb., 22:27, Mike Edenfield <kut...@kutulu.org> wrote:
>
> Is there a way to do either of these things:
>
> 1. Enable the Native Heap tab inside Eclipse's DDMS plug-in?
>

You can try to modify the plugin.xml of the eclipse ddms plugin.
Goto your eclipse/plugin folder and locate the file
com.android.ide.eclipse.ddms_<version>.jar

Extract the plugin.xml from the archive and add the following code
after on of the view elements (I've added mine below the Logcat View)

<view
allowMultiple="false"
category="com.android.ide.eclipse.ddms.views.category"
class="com.android.ide.eclipse.ddms.views.NativeHeapView"
icon="icons/heap.png"
id="com.android.ide.eclipse.ddms.views.NativeHeapView"
name="NativeHeap"/>

Update your plugin archive with the modified plugin.xml and start
eclipse. You should now be able to open a view called "NativeHeap"
Reply all
Reply to author
Forward
0 new messages