[PR #903] [CLOSED] fix(android): allow explicit JADX heap limits #2332

Closed
opened 2026-10-16 21:17:25 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/903
Author: @kaoru0822-kitauji
Created: 10/7/2026
Status: ❌ Closed

Base: main ← Head: fix/jadx-configurable-heap


📝 Commits (1)

  • 8106a8c fix(android): allow explicit JADX heap limits

📊 Changes

8 files changed (+132 additions, -19 deletions)

View changed files

📝 docs/android-analysis.md (+11 -5)
📝 src/android/JadxConfiguration.ts (+29 -2)
📝 src/android/JadxProvider.ts (+5 -3)
📝 src/android/JadxRelease.ts (+5 -4)
📝 src/android/JadxSession.ts (+2 -2)
📝 tests/boundary/android/jadxConfiguration.test.ts (+42 -1)
📝 tests/boundary/android/jadxIntegration.test.ts (+27 -0)
📝 tests/fixtures/android/jadx.ts (+11 -2)

📄 Description

Summary

JadxProvider inherited JAVA_TOOL_OPTIONS, but it also pinned -Xmx512m in both the Java command and _JAVA_OPTIONS. A caller-provided -Xmx8g therefore could not raise the owned worker's heap, which matches the behavior reported in #893.

This change adds the provider-specific REA_JADX_HEAP_LIMIT_MIB setting:

  • the default remains 512 MiB;
  • a positive integer such as 8192 drives both JVM heap authorities;
  • engine metadata reports the selected value rather than a constant;
  • malformed, zero, negative, fractional, padded, and numerically unsafe values fail with an actionable capability-configuration error.

The Android guide documents the setting and retains the distinction between JVM heap and total RSS. No MCP schema or generated catalog changes.

Fixes #893.

Verification

  • New configuration regressions cover the 512 MiB default, an explicit 8192 MiB value, and invalid values. These fail on main and pass here.
  • New owned-process boundary regression asserts that:
    • ambient JAVA_TOOL_OPTIONS=-Xmx8g is still inherited;
    • REA_JADX_HEAP_LIMIT_MIB=8192 produces -Xmx8192m in the command and _JAVA_OPTIONS;
    • normalized engine metadata reports heap_limit_mib: 8192.
  • vitest run tests/boundary/android/jadxConfiguration.test.ts — 10 passed.
  • TypeScript 5.9.3 tsc --noEmit — passed.
  • npm run lint, npm run knip, npm run metadata:check, and npm run verify:test-discovery — passed.
  • Targeted Oxfmt and git diff --check — passed.
  • Generated-document checks were run directly after a TypeScript 5.9.3 build — passed.

Material unverified coverage

The reporter's 133 MB, 11-DEX APK was not available, so this does not claim that 8 GiB is sufficient or that JADX can partially load that target. The digest-pinned ApiDemos/JADX 0.7.1 real lane reached a successful APK load and analysis, but this sandbox has no /proc; REA correctly rejected cleanup as unverified, so the complete real-provider lane and the synthetic owned-process boundary suite could not pass locally. The repository-default TypeScript 7 and full parallel formatting checks have the same sandbox /proc dependency; equivalent stable-compiler and targeted formatting checks passed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/903 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/7/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/jadx-configurable-heap` --- ### 📝 Commits (1) - [`8106a8c`](https://github.com/morluto/rea/commit/8106a8cf8e1a89c0b22403f591e7576596789481) fix(android): allow explicit JADX heap limits ### 📊 Changes **8 files changed** (+132 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `docs/android-analysis.md` (+11 -5) 📝 `src/android/JadxConfiguration.ts` (+29 -2) 📝 `src/android/JadxProvider.ts` (+5 -3) 📝 `src/android/JadxRelease.ts` (+5 -4) 📝 `src/android/JadxSession.ts` (+2 -2) 📝 `tests/boundary/android/jadxConfiguration.test.ts` (+42 -1) 📝 `tests/boundary/android/jadxIntegration.test.ts` (+27 -0) 📝 `tests/fixtures/android/jadx.ts` (+11 -2) </details> ### 📄 Description ## Summary `JadxProvider` inherited `JAVA_TOOL_OPTIONS`, but it also pinned `-Xmx512m` in both the Java command and `_JAVA_OPTIONS`. A caller-provided `-Xmx8g` therefore could not raise the owned worker's heap, which matches the behavior reported in #893. This change adds the provider-specific `REA_JADX_HEAP_LIMIT_MIB` setting: - the default remains 512 MiB; - a positive integer such as `8192` drives both JVM heap authorities; - engine metadata reports the selected value rather than a constant; - malformed, zero, negative, fractional, padded, and numerically unsafe values fail with an actionable capability-configuration error. The Android guide documents the setting and retains the distinction between JVM heap and total RSS. No MCP schema or generated catalog changes. Fixes #893. ## Verification - New configuration regressions cover the 512 MiB default, an explicit 8192 MiB value, and invalid values. These fail on `main` and pass here. - New owned-process boundary regression asserts that: - ambient `JAVA_TOOL_OPTIONS=-Xmx8g` is still inherited; - `REA_JADX_HEAP_LIMIT_MIB=8192` produces `-Xmx8192m` in the command and `_JAVA_OPTIONS`; - normalized engine metadata reports `heap_limit_mib: 8192`. - `vitest run tests/boundary/android/jadxConfiguration.test.ts` — 10 passed. - TypeScript 5.9.3 `tsc --noEmit` — passed. - `npm run lint`, `npm run knip`, `npm run metadata:check`, and `npm run verify:test-discovery` — passed. - Targeted Oxfmt and `git diff --check` — passed. - Generated-document checks were run directly after a TypeScript 5.9.3 build — passed. ## Material unverified coverage The reporter's 133 MB, 11-DEX APK was not available, so this does not claim that 8 GiB is sufficient or that JADX can partially load that target. The digest-pinned ApiDemos/JADX 0.7.1 real lane reached a successful APK load and analysis, but this sandbox has no `/proc`; REA correctly rejected cleanup as unverified, so the complete real-provider lane and the synthetic owned-process boundary suite could not pass locally. The repository-default TypeScript 7 and full parallel formatting checks have the same sandbox `/proc` dependency; equivalent stable-compiler and targeted formatting checks passed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:17:25 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2332
No description provided.