[Ruboto-core]Too much memory consumption when pre-dexing jruby

418 views
Skip to first unread message

黎荣熙

unread,
Feb 23, 2013, 1:16:06 AM2/23/13
to rub...@googlegroups.com
Hi,
I'm working on issue#165. However, when I finished my work and tried to test it on my device. I encountered a frustrating problem. It seems my 2GB-RAM PC is just too weak? Does anybody else has the same problem?
Here's the log:
-dex:
      [dex] input: /home/asakawa/projects/test/ruboto-core/bin/classes
      [dex] input: /home/asakawa/projects/test/ruboto-core/libs/jruby-stdlib-1.7.2.jar
      [dex] input: /home/asakawa/sdk/tools/support/annotations.jar
      [dex] input: /home/asakawa/projects/test/ruboto-core/libs/jruby-core-1.7.2.jar
      [dex] input: /home/asakawa/projects/test/ruboto-core/libs/bundle.jar
      [dex] input: /home/asakawa/projects/test/ruboto-core/libs/dx.jar
      [dex] Pre-Dexing /home/asakawa/projects/test/ruboto-core/libs/jruby-stdlib-1.7.2.jar -> jruby-stdlib-1.7.2-44e580d50a770c92ed2a082f6fe1f3bf.jar
      [dex] Pre-Dexing /home/asakawa/sdk/tools/support/annotations.jar -> annotations-21d131775008412b3d40b990af5c494b.jar
      [dex] Pre-Dexing /home/asakawa/projects/test/ruboto-core/libs/jruby-core-1.7.2.jar -> jruby-core-1.7.2-276ad79d6d299c261905bf6fbfe9ae4f.jar
       [dx] 
       [dx] UNEXPECTED TOP-LEVEL ERROR:
       [dx] java.lang.OutOfMemoryError: GC overhead limit exceeded
       [dx]     at java.util.ArrayList.<init>(ArrayList.java:132)
       [dx]     at java.util.ArrayList.<init>(ArrayList.java:139)
       [dx]     at com.android.dx.ssa.Dominators.compress(Dominators.java:120)
       [dx]     at com.android.dx.ssa.Dominators.eval(Dominators.java:160)
       [dx]     at com.android.dx.ssa.Dominators.run(Dominators.java:207)
       [dx]     at com.android.dx.ssa.Dominators.make(Dominators.java:90)
       [dx]     at com.android.dx.ssa.DomFront.run(DomFront.java:90)
       [dx]     at com.android.dx.ssa.SsaConverter.placePhiFunctions(SsaConverter.java:298)
       [dx]     at com.android.dx.ssa.SsaConverter.convertToSsaMethod(SsaConverter.java:52)
       [dx]     at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:99)
       [dx]     at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:73)
       [dx]     at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:273)
       [dx]     at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:134)
       [dx]     at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:87)
       [dx]     at com.android.dx.command.dexer.Main.processClass(Main.java:487)
       [dx]     at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
       [dx]     at com.android.dx.command.dexer.Main.access$400(Main.java:67)
       [dx]     at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
       [dx]     at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
       [dx]     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
       [dx]     at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
       [dx]     at com.android.dx.command.dexer.Main.processOne(Main.java:422)
       [dx]     at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
       [dx]     at com.android.dx.command.dexer.Main.run(Main.java:209)
       [dx]     at com.android.dx.command.dexer.Main.main(Main.java:174)
       [dx]     at com.android.dx.command.Main.main(Main.java:91)
BUILD FAILED
/home/asakawa/sdk/tools/ant/build.xml:881: The following error occurred while executing this line:
/home/asakawa/sdk/tools/ant/build.xml:883: The following error occurred while executing this line:
/home/asakawa/sdk/tools/ant/build.xml:895: The following error occurred while executing this line:
/home/asakawa/sdk/tools/ant/build.xml:290: null returned: 3
Total time: 1 minute 17 seconds

--
-------------------------------------
Asakawa Ryu(@nyan_gawa)
Department of Electronic Engineering
Tsinghua University, Beijing China

Uwe Kubosch

unread,
Mar 6, 2013, 6:50:52 AM3/6/13
to rub...@googlegroups.com
On 2013-02-23, at 07:16, 黎荣熙 <ryu...@gmail.com> wrote:

> I'm working on issue#165. However, when I finished my work and tried to test it on my device. I encountered a frustrating problem. It seems my 2GB-RAM PC is just too weak? Does anybody else has the same problem?
> Here's the log:
> -dex:
> [dx] UNEXPECTED TOP-LEVEL ERROR:
> [dx] java.lang.OutOfMemoryError: GC overhead limit exceeded
> BUILD FAILED

Thanks for working on the translation issue!

2GB RAM is the absolute lower limit for working with Android on a project of any substantial size. Ruboto adds the JRuby jar which increases the dex RAM requirements to at least 2GB.

Do you have some swap space available? In that case you could try the new Ruboto 0.10.2 release candidate. It will increase the -Xmx heap size option of the dex command to 2560MB for you.

Please try it and tell me how it works out.

--
--
Uwe Kubosch
http://ruboto.org/



时永方

unread,
Aug 21, 2013, 10:06:09 PM8/21/13
to rub...@googlegroups.com
Obviously, it's due to the dx tool out of memory. Try to do as follows:

in "<android-sdk-folder>/platform-tools\dx.bat",
change the default value from 1G to a larger number, say:
set defaultXmx=-Xmx1624M

It works for my case. Good Luck!

时永方

unread,
Aug 21, 2013, 10:17:46 PM8/21/13
to rub...@googlegroups.com
obviously, it's due to dx tool out of memory. Try to enlarge the memory:

in "<android-sdk-folder>/platform-tools/dx.bat",
change the parameter to a larger number:
set defaultXmx=-Xmx1624M

It works for my case, GOOD luck!



On Saturday, February 23, 2013 2:16:06 PM UTC+8, Nyangawa wrote:

Nisha

unread,
Mar 5, 2016, 6:47:34 PM3/5/16
to Ruboto (JRuby on Android)
Hi,

I am also facing the same issue. But I dont find /dx.bat file inside platform-tool
What to do?
Please help! 

Uwe Kubosch

unread,
Mar 5, 2016, 8:22:58 PM3/5/16
to rub...@googlegroups.com
Hi Nisha!

You need to locate the dx script to be able to patch it.

We currently have two issues in the tracker for this:

https://github.com/ruboto/ruboto/issues/778
https://github.com/ruboto/ruboto/pull/796

They should be resolved for Ruboto 1.5.0 due this month.
--
Uwe Kubosch
u...@kubosch.no
http://kubosch.no/




Reply all
Reply to author
Forward
0 new messages