Android Question out of memory compiling

Discussion in 'Android Questions' started by merlin2049er, May 18, 2015.

  1. merlin2049er

    merlin2049er Well-Known Member Licensed User

    Hi,
    I got an out of memory error while compiling, after adding admob resources to my latest build.

    Code:
    UNEXPECTED TOP-LEVEL ERROR:
    java.lang.OutOfMemoryError: GC overhead limit exceeded
        at com.android.dx.ssa.SsaRenamer.<init>(SsaRenamer.java:
    111)
        at com.android.dx.ssa.SsaConverter.convertToSsaMethod(SsaConverter.java:
    52)
        at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:
    98)
        at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:
    72)
        at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:
    297)
        at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:
    137)
        at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:
    93)
        at com.android.dx.command.dexer.Main.processClass(Main.java:
    729)
        at com.android.dx.command.dexer.Main.processFileBytes(Main.java:
    673)
        at com.android.dx.command.dexer.Main.access$
    300(Main.java:83)
        at com.android.dx.command.dexer.Main$
    1.processFileBytes(Main.java:602)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:
    284)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:
    166)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:
    144)
        at com.android.dx.command.dexer.Main.processOne(Main.java:
    632)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:
    510)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:
    280)
        at com.android.dx.command.dexer.Main.run(Main.java:
    246)
        at com.android.dx.command.dexer.Main.main(Main.java:
    215)
        at com.android.dx.command.Main.main(Main.java:
    106)
    Picked up _JAVA_OPTIONS:  -Xmx512M
        Optimized dexer failed. Switching 
    to Standard dexer.

    Any options to increase my java overhead? I've got 16gb ram in my pc.
     
  2. DonManfred

    DonManfred Expert Licensed User

    Have you tried to add
    Code:
    SetApplicationAttribute(android:largeHeap, "true")
    to your manifest?
     
  3. DonManfred

    DonManfred Expert Licensed User

    Check the video here. Ok, it´s a german windows but i think you will find what you are searching (setting the _JAVA_OPTIONS Environment-Variable)
     
    merlin2049er likes this.
  4. merlin2049er

    merlin2049er Well-Known Member Licensed User

    ok, thanks.

    I tried the adding that to the manifest, it didn't help much.

    I removed it and set the _java_options
    from -Xmx-512m to -Xmx-1g

    That worked.
     
    DonManfred likes this.
  5. Erel

    Erel Administrator Staff Member Licensed User

  6. merlin2049er

    merlin2049er Well-Known Member Licensed User

    Thanks, I had forgotten where the b4a config file was.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice