Android Question Can't solve this error: "UNEXPECTED TOP-LEVEL ERROR: java.lang.OutOfMemoryError: GC overhead limit e

Luis Felipe

Member
Licensed User
Longtime User
Hello everyone,

Since yesterday I got this compilng error message:
B4X:
B4A version: 5.20
Parsing code.    (0.00s)
Compiling code.    (0.21s)
Compiling layouts code.    (0.00s)
Generating R file.    (0.47s)
Compiling debugger engine code.    (1.01s)
Compiling generated Java code.    (1.61s)
Convert byte code - optimized dex.    Error
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: GC overhead limit exceeded
    at com.android.dx.util.Bits.makeBitSet(Bits.java:38)
    at com.android.dx.cf.code.BasicBlocker.<init>(BasicBlocker.java:107)
    at com.android.dx.cf.code.BasicBlocker.identifyBlocks(BasicBlocker.java:79)
    at com.android.dx.cf.code.Ropper.<init>(Ropper.java:377)
    at com.android.dx.cf.code.Ropper.convert(Ropper.java:348)
    at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:280)
    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:82)
    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:279)
    at com.android.dx.command.dexer.Main.run(Main.java:245)
    at com.android.dx.command.dexer.Main.main(Main.java:214)
    at com.android.dx.command.Main.main(Main.java:106)

I've just tried the example shown in the "Google Maps Android v2 Tutorial" from this forum.
I've searched for this type of error and tried what they said but nothing solved my problem.
I've to mention too that I can't find (and I've searched in every corner of my pc hdd !) the .ini file in order to increase the memory.
I got a recent PC with Windows 7 and plenty of RAM and HDD Gb.
I've deleted apps in my smartphone, a BQ M5 with 2 Gb of RAM and 16 of internal memory (5 Gb free) with Android 5.0.1.

And I added this line in the Manifest Editor:
B4X:
SetApplicationAttribute(android:largeHeap,"true")

So any solution is wellcome.

Here is the code I got:
B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
    #AdditionalRes: C:\Android\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

'Activity module
Sub Process_Globals

End Sub

Sub Globals
   Dim mFragment As MapFragment
   Dim gmap As GoogleMap
   Dim MapPanel As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
   MapPanel.Initialize("")
   Activity.AddView(MapPanel, 0, 0, 100%x, 100%y)
   If mFragment.IsGooglePlayServicesAvailable = False Then
      ToastMessageShow("Google Play services not available.", True)
   Else
      mFragment.Initialize("Map", MapPanel)
   End If
End Sub

Sub Map_Ready
   Log("map ready")
   gmap = mFragment.GetMap
   If gmap.IsInitialized = False Then
      ToastMessageShow("Error initializing map.", True)
   Else
      gmap.AddMarker(36, 15, "Hello!!!")
      Dim cp As CameraPosition
      cp.Initialize(36, 15, gmap.CameraPosition.Zoom)
      gmap.AnimateCamera(cp)
   End If
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Thank you in advance ofr your time and help.
 
Top