简体   繁体   English

Eclipse Java堆空间

[英]Eclipse Java heap space

I am trying to integrate qoppa pdf reader to my android application 我正在尝试将qoppa pdf阅读器集成到我的android应用程序中

I did like it was described here: http://www.qoppa.com/android/pdfsdk/guide/index.html - add jar file into classpath of my project. 我确实喜欢这里描述的内容: http : //www.qoppa.com/android/pdfsdk/guide/index.html-将jar文件添加到我的项目的类路径中。 - add assets folder. -添加资产文件夹。 - add libs folder. -添加libs文件夹。

When I start Eclipse, everything works fine, I can open the projects in my workspace and continue implementing. 启动Eclipse时,一切正常,我可以在工作区中打开项目并继续执行。 But when running the pdf project as a new Eclipse instance, i get this error 但是当将pdf项目作为新的Eclipse实例运行时,出现此错误

    [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. 我在网上搜索,因此我发现必须在eclipse.ini文件和“运行配置”中增加PermGen的大小。 Here are my evlipse.ini after some changes: 经过一些更改后,这是我的evlipse.ini:

-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. 我认为这是因为qoppapdf.jar造成的,jar的大小非常大,超过了4000000个字节。 But it is supposed to work because there are samples using this jar, i don't know why my eclipse can't do it 但这应该起作用,因为有一些样品在使用这个罐子,我不知道为什么我的日食不能做到这一点

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. 这样做时,Eclipse将仅从jar中获取代码中所需的类,而不是从jar中存储所有类。

You need to increase the allocated memory for your running configuration, not for eclipse. 您需要为正在运行的配置而不是日食增加分配的内存。 Add the -Xms256m and -Xms1024m under VM arguments field. 在VM arguments字段下添加-Xms256m和-Xms1024m。

在此处输入图片说明

同样将-Xms256m更改为-Xms1024m,它只给它256兆,Java应用程序占用大量内存,并且需要大量内存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM