Repository navigation
Description
Summary
search_android_classes and inspect_android_package both fail with Java heap space on a production APK (133MB, 11 dex files). Tested with JAVA_TOOL_OPTIONS=-Xmx8g — same result. The env var reaches REA's MCP process but does not appear to propagate to the JADX subprocess.
Environment
- REA:
[email protected] - jadx-headless-mcp:
0.7.1(SHA256 matchesJADX_RELEASEin source) - Java: OpenJDK 25.0.4.1
- OS: Fedora 44, 32GB RAM
- Claude Code MCP integration
Steps
npx rea-agents@latest setup --client claude_code --yes
# Set env in .claude.json mcpServers.rea.env
# REA_JADX_MCP_JAR=/opt/jadx/jadx-headless-mcp-0.7.1-all.jar
# JAVA_TOOL_OPTIONS=-Xmx8gThen via MCP:
search_android_classes(path="/path/to/app.apk", query="UserManager")
Error
{
"code": "execution_failure",
"details": {
"provider_id": "jadx",
"operation": "search_android_classes",
"diagnostics": {
"upstream_operation": "load_apk",
"reason": "load failed: Java heap space"
}
}
}APK characteristics
- 133MB total
- 11 DEX files (multidex)
- Real production app from Play Store
- Not obfuscated beyond standard ProGuard
Observations
-
JAVA_TOOL_OPTIONS=-Xmx8gis confirmed picked up when running the JAR directly (Picked up JAVA_TOOL_OPTIONS: -Xmx8g), but the OOM persists through REA's MCP layer — suggests the subprocess env isn't inheriting the parent's env vars, or the JAR itself caps heap internally. -
The JAR manifest has no JVM flags (
Main-Class: com.atxx.jhmcp.MainKt, nothing else). -
Same failure on 8GB explicit heap with 32GB system RAM — the APK genuinely needs more than JADX's default allocation, and there's no documented way to control heap for the JADX subprocess spawned by REA.
Expected
Either:
- REA propagates
JAVA_TOOL_OPTIONS/_JAVA_OPTIONSto the JADX subprocess - A
REA_JADX_JAVA_OPTSenv var for explicit control - Graceful degradation: partial-load or per-dex analysis instead of loading all 11 dex files at once
Large multidex APKs are common in production (banking, logistics, super-apps). A reverse engineering tool that can't open them is limited to demos and CTFs.
Activity
kaoru0822-kitauji commentedon Oct 7, 2026
Addressed on
mainby #908, after 4.1.0:JAVA_TOOL_OPTIONS,JDK_JAVA_OPTIONS, and_JAVA_OPTIONS, and REA does not replace them.REA_JADX_HEAP_MIB=8192adds-Xmx8192m.REA_JADX_ACTIVE_PROCESSOR_COUNTis optional.Runtime.maxMemory(), so you can confirm which heap actually applied.See Android analysis. This is a breaking change: the bridge now needs a full JDK 17+ that includes its compiler module.
This was not re-tested against a 133 MB, 11-dex APK. If the next release (release PR #771) still runs out of memory with
REA_JADX_HEAP_MIBset, please reopen with the reportedmaxMemoryvalue.MG1937 commentedon Oct 12, 2026
Hello author, could you please add support for this? The JVM memory is often maxed out, and it's truly painful and almost unusable...
#1451 (comment)
作者你好,能适配一下这个吗,jvm内存时常占满,确实很痛苦几乎没法使用...
#1451 (comment)