Hello. I have been trying to use traceview for profiling my Android
app. So far I have gotten it to work on very small parts of the
program. If I use it for bigger chunks it creates too much information
(.trace file is too large) and I get an OutOfMemory (heap memory)
error from the java compiler. I tried some tricks with setting higher
min and max heap memory values but no luck.

If anyone has used traceview with similar effects before I would
highly appreciate any tips you may have.

Here are the details. First I am reproducing the error message:

$ traceview.bat tmp.trace
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at com.android.traceview.TimeLineView.setData
(TimeLineView.java:433)
        at com.android.traceview.TimeLineView.<init>(TimeLineView.java:
316)
        at com.android.traceview.MainWindow.createContents
(MainWindow.java:93)
        at org.eclipse.jface.window.Window.create(Window.java:426)
        at org.eclipse.jface.window.Window.open(Window.java:785)
        at com.android.traceview.MainWindow.run(MainWindow.java:58)
        at com.android.traceview.MainWindow.main(MainWindow.java:190)


On windows traceview works from a batch file that is reproduced below.
The last line is where I am mucking with the memory settings. That
does not seem to affect the behavior though. The parameters-- -XX:
+HeapDumpOnOutOfMemoryError -Xms2g -Xmx2g-- have been added by me ...
again they have no effect. Maybe because they should be used when
generating the .jar file itself?


//////////// traceview.bat /////////////////////////
rem don't modify the caller's environment
setlocal

rem Set up prog to be the path of this script, including following
symlinks,
rem and set up progdir to be the fully-qualified pathname of its
directory.
set prog=%~f0

rem Change current directory to where traceview is, to avoid issues
with directories
rem containing whitespaces.
cd %~dp0

set jarfile=traceview.jar
set frameworkdir=
set libdir=

if exist %frameworkdir%%jarfile% goto JarFileOk
    set frameworkdir=lib\
    set libdir=lib\

if exist %frameworkdir%%jarfile% goto JarFileOk
    set frameworkdir=..\framework\
    set libdir=..\lib\

:JarFileOk

set jarpath=%frameworkdir%%jarfile%

C:\Program Files\Java\jdk1.6.0_12\bin\java -XX:
+HeapDumpOnOutOfMemoryError -Xms2g -Xmx2g -Djava.ext.dirs=%frameworkdir
% -Djava.library.path=%libdir% -jar %jarpath% %*
//////////////////////////////////////////////

Cheers, Boris

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to