haythem souissi
haythem souissi

Reputation: 3273

Eclipse Java heap space

I am trying to integrate qoppa pdf reader to my android application

I did like it was described here: http://www.qoppa.com/android/pdfsdk/guide/index.html - add jar file into classpath of my project. - add assets folder. - add libs folder.

When I start Eclipse, everything works fine, I can open the projects in my workspace and continue implementing. But when running the pdf project as a new Eclipse instance, i get this error

    [2012-10-29 22:23:25 - com.test] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(c.b.b.c.b.b.b.b.b.i$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2012-10-29 22:26:21 - Dex Loader] Unable to execute dex: Java heap space
[2012-10-29 22:26:23 - com.test] Conversion to Dalvik format failed: Unable to execute dex: Java heap space

I tryed clean my project, but still getting the error.

I searched in the net, so i found that I have to increased the PermGen size in the eclipse.ini file and in the Run Configuration. Here are my evlipse.ini after some changes:

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
1024M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
1024m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms256m
-Xmx1024m

No use, I still get the error.

What could be the problem?

i Think it is because of qoppapdf.jar, the size of the jar is huge, more than 4000000 bytes. But it is supposed to work because there are samples using this jar, i don't know why my eclipse can't do it

Upvotes: 1

Views: 8171

Answers (3)

Mihir Shah
Mihir Shah

Reputation: 996

Try the following:

-> Right click your project. 
-> Go to Properties 
-> Java Build Path 
-> Order and Export.
-> Uncheck the check box against your included library. 
-> Press OK and run the project.

On doing this Eclipse will take only the classes which are needed in the code, from the jar instead of storing all the classes from the jar.

Upvotes: 4

Patrick Evans
Patrick Evans

Reputation: 42746

change the -Xms256m to -Xms1024m as well, its only giving it 256 megs, java apps are memory intensive and need a lot.

Upvotes: 1

dan
dan

Reputation: 13272

You need to increase the allocated memory for your running configuration, not for eclipse. Add the -Xms256m and -Xms1024m under VM arguments field.

enter image description here

Upvotes: 3

Related Questions