tags:

views:

155

answers:

1

I start the Method Profiler for a process, then leave it run for about 5-10 secs, then I stop it. I see a progress that a file is pulled from the sdcard, than I get this Exception

The trance file is 8.2MB

[2010-05-23 18:45:42] Traceview: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
[2010-05-23 18:45:42] Traceview:    at java.util.Arrays.copyOf(Unknown Source)
[2010-05-23 18:45:42] Traceview:    at java.util.Arrays.copyOf(Unknown Source)
[2010-05-23 18:45:42] Traceview:    at java.util.ArrayList.toArray(Unknown Source)
[2010-05-23 18:45:42] Traceview:    at java.util.Collections.sort(Unknown Source)
[2010-05-23 18:45:42] Traceview:    at com.android.traceview.TimeLineView.setData(TimeLineView.java:370)
[2010-05-23 18:45:42] Traceview:    at com.android.traceview.TimeLineView.<init>(TimeLineView.java:316)
[2010-05-23 18:45:42] Traceview:    at com.android.traceview.MainWindow.createContents(MainWindow.java:95)
[2010-05-23 18:45:42] Traceview:    at org.eclipse.jface.window.Window.create(Window.java:431)
[2010-05-23 18:45:42] Traceview:    at org.eclipse.jface.window.Window.open(Window.java:790)
[2010-05-23 18:45:42] Traceview:    at com.android.traceview.MainWindow.run(MainWindow.java:60)
[2010-05-23 18:45:42] Traceview:    at com.android.traceview.MainWindow.main(MainWindow.java:224)

What I am doing wrong?

+1  A: 

Try using the -Xms and -Xmx VM flags to increase the heap space.

JRL
Where to add those, how?
Pentium10
On the command line. If you're using Eclipse, you'd run it with a command line such as this: `[path]\eclipse.exe -vmargs -Xmx<memory size> -Xms<memory size>`
JRL