On Apr 29, 12:43 pm, Sanra <snarr...@gmail.com> wrote:
> 1. How to generate a Full Java stack trace (basically thread stack) in
> Android. In J2SE, we use something like this -  send a signal to the
> JVM; the JVM generates a stack trace for you; or we can also use
> debugging tools or Java API calls like Thread.dumpStack. What are the
> android equivalents to get the same output?

% kill -3 <pid>

Watch the logcat output.  Note you'll need a rooted or developer
device to be able to send a kill signal to a process.

Can also use DDMS to grab the traces from individual threads -- select
the app, go to the Threads tab, double-click on a thread.

Thread.dumpStack() works on recent versions of Android.

> 2. How to generate a java heap dump? And are there any tools to
> analyze the heap dumps ?

http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=docs/heap-profiling.html;hb=HEAD

Depending on what version of DDMS you have and what version of Android
is running on the device, you may be able to just click the "grab heap
dump" icon.  jhat (part of the JDK) and Eclipse MAT are two free tools
for analyzing them.

> 3. Does thread and heap dump be generated if the Application crashes
> due to a segment violation ? Where does the core files be generated?

Native stack traces are written to the log file.  No core files are
generated because the core dump limit is set to zero.

> 4. Are there any profiling APIs in android APIs that will allow to
> measure the UI performance and responsiveness (basically times taken
> to launch an activity/application and also times taken to scroll a
> list)?

The method profiling has a lot of overhead associated with it and so
is a poor way to measure absolute time.  You would need to insert your
own timer calls and perform a series of operations.

> 5. Is there a tool similar to hprof that is available in J2SE for CPU
> usage, heap allocation statistics etc?

The heap dump is HPROF format.

> 6. Tool on GC activities..

Not sure what that means.

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to