You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, is there any way to pass java arguments for increasing java heap space? Currently mine crashes like this:
Creating output directory: /base-decompiled0000%) |
Output directory created: /base-decompiled
Running jadx on base.apk
INFO - loading ...
ERROR - Process error:
java.lang.OutOfMemoryError: Java heap space
at java.base/jdk.internal.misc.Unsafe.allocateUninitializedArray(Unsafe.java:1375)
at java.base/java.lang.StringConcatHelper.newArray(StringConcatHelper.java:497)
at java.base/java.lang.StringConcatHelper.newArrayWithSuffix(StringConcatHelper.java:475)
at java.base/java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(DirectMethodHandle$Holder)
at java.base/java.lang.invoke.LambdaForm$MH/0x000000100100d000.invoke(LambdaForm$MH)
at java.base/java.lang.invoke.LambdaForm$MH/0x000000100100e000.invoke(LambdaForm$MH)
at java.base/java.lang.invoke.Invokers$Holder.linkToTargetMethod(Invokers$Holder)
at jadx.core.utils.Utils.makeQualifiedObjectName(Utils.java:55)
at jadx.core.codegen.TypeGen.signature(TypeGen.java:25)
at jadx.core.dex.info.MethodInfo.makeShortId(MethodInfo.java:90)
at jadx.core.dex.info.MethodInfo.<init>(MethodInfo.java:33)
at jadx.core.dex.info.MethodInfo.fromRef(MethodInfo.java:52)
at jadx.core.dex.nodes.MethodNode.<init>(MethodNode.java:92)
at jadx.core.dex.nodes.MethodNode.build(MethodNode.java:86)
at jadx.core.dex.nodes.ClassNode.lambda$load$1(ClassNode.java:126)
at jadx.core.dex.nodes.ClassNode$$Lambda$217/0x00000010011c8000.apply(Unknown Source)
at jadx.api.plugins.input.data.impl.ListConsumer.accept(ListConsumer.java:25)
at jadx.plugins.input.dex.sections.DexClassData.readMethods(DexClassData.java:170)
at jadx.plugins.input.dex.sections.DexClassData.visitMethods(DexClassData.java:145)
at jadx.plugins.input.dex.sections.DexClassData.visitFieldsAndMethods(DexClassData.java:112)
at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:127)
at jadx.core.dex.nodes.ClassNode.<init>(ClassNode.java:115)
at jadx.core.dex.nodes.RootNode.lambda$loadClasses$0(RootNode.java:128)
at jadx.core.dex.nodes.RootNode$$Lambda$212/0x00000010011be700.accept(Unknown Source)
at jadx.plugins.input.dex.DexReader.visitClasses(DexReader.java:35)
at jadx.plugins.input.dex.DexLoadResult.visitClasses(DexLoadResult.java:26)
at jadx.core.dex.nodes.RootNode.loadClasses(RootNode.java:126)
at jadx.api.JadxDecompiler.load(JadxDecompiler.java:125)
at jadx.cli.JadxCLI.processAndSave(JadxCLI.java:51)
at jadx.cli.JadxCLI.execute(JadxCLI.java:38)
at jadx.cli.JadxCLI.main(JadxCLI.java:22)
Successfully decompiled base.apk with jadx
Indexing decompiled files in /base-decompiled/jadx...
Found 0 decompiled files for base.apk
Status: COMPLETE | Decompiled: 1/1 (100.000000%) |
Decompiling COMPLETE. Decompiled 1 files with 1 errors. Elapsed time: 0:00:32.582309
Status: COMPLETE | Decompiled: 1/1 (100.000000%) |
Found 0 new secrets (0 unique).
Decompiled 1 files with 1 errors in 0:00:32.582309.
Scanned 0 files and found 0 secrets in None.
Total Elapsed time: 0:00:32.592548
Output written to secrets_output.json
APKscan done. No secrets found.
The text was updated successfully, but these errors were encountered:
Thanks for your feedback! I saw your already closed this issue but wanted to provide a solution anyway for anyone else reading this.
Heap size is actually set by your environment's _JAVA_OPTIONS, not by APKscan, JADX, or any other dependancies.
To increase the heap space for a Java application and avoid java.lang.OutOfMemoryError: Java heap space, you can modify the _JAVA_OPTIONS environment variable to specify the desired heap size.
# Desired heap size ie: 1g = 1GB, 2g = 2GB, 4g = 4GB, 100m = 100MB, etc
heap_size="4g"
heap_size_arg="-Xmx$heap_size"# Check if _JAVA_OPTIONS is setif [ -z"$_JAVA_OPTIONS" ];thenexport _JAVA_OPTIONS="$heap_size_arg"else# Check if _JAVA_OPTIONS contains -Xmxifecho"$_JAVA_OPTIONS"| grep -q '\-Xmx';then# Replace existing -Xmx valueexport _JAVA_OPTIONS=$(echo "$_JAVA_OPTIONS"| sed -E "s/\-Xmx[0-9]+[kKmMgG]/$heap_size_arg/")else# Add -Xmx valueexport _JAVA_OPTIONS="$_JAVA_OPTIONS$heap_size_arg"fifi# Verify the settingecho"Current _JAVA_OPTIONS: $_JAVA_OPTIONS"
Hi, is there any way to pass java arguments for increasing java heap space? Currently mine crashes like this:
The text was updated successfully, but these errors were encountered: