Skip to content

Suppress guest explicit GC with universal transform version - #110

Merged
H3nb merged 1 commit into
alphafrom
codex/suppress-midlet-explicit-gc
Aug 27, 2026
Merged

Suppress guest explicit GC with universal transform version#110
H3nb merged 1 commit into
alphafrom
codex/suppress-midlet-explicit-gc

Conversation

@H3nb

@H3nb H3nb commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • rewrite guest System.gc() and Runtime.gc() calls to an emulator-owned advisory bridge
  • replace timing-only conversion metadata with one universal JLMod-Transform-Version marker
  • make existing timing-marked MIDlets reconvert automatically and remove their legacy markers
  • preserve Runtime.gc() receiver null semantics and keep normal ART allocation-pressure GC unchanged

Root cause

Green Farm calls System.gc() repeatedly from guest bytecode. On the tested Android 16 / HyperOS host with target SDK 35+, ART honored those calls as concurrent mark-compact collections, causing visible loading stalls and frequent object-address relocation. This is independent of the Memory Editor implementation in #109 and independent of emulation speed.

Universal reconversion contract

MidletTransformMetadata.TRANSFORM_VERSION is now the single compatibility version for all converter output and runtime bridge contracts. Future transformer changes only need to increment this value. The existing AppReconverter path will rebuild installed MIDlets with retained source before launch.

Validation

  • CI-equivalent local lint, unit tests, screenshot validation, debug APK, and test APK: passed
  • complete dexlib unit suite including JVM bytecode and real DEX verification: passed
  • Emulator Release build with R8/lintVital: passed; both MidletSystem.gc bridge overloads are retained
  • Android 16 device: legacy timing marker triggered AutoReconversionActivity and produced JLMod-Transform-Version: 1
  • Green Farm converted DEX: 21 bridge GC callsites, 0 direct System.gc() callsites
  • Green Farm runtime after reconversion: 0 explicit compacting GC during the measured launch window; loading animation visually smooth
  • original shared Green Farm archive and descriptor restored byte-for-byte after the side-by-side test

@H3nb
H3nb merged commit 2a49555 into alpha Aug 27, 2026
1 check passed
@H3nb
H3nb deleted the codex/suppress-midlet-explicit-gc branch August 27, 2026 14:45
H3nb added a commit that referenced this pull request Aug 27, 2026
Rewrite guest System.gc() and Runtime.gc() callsites to an advisory emulator bridge so repeated guest hints cannot force ART compacting collections.

Replace timing-specific conversion metadata with a single universal transform version. Existing retained MIDlets reconvert automatically, and future transformer or bridge changes only need to increment that version.
H3nb added a commit that referenced this pull request Aug 28, 2026
Rewrite guest System.gc() and Runtime.gc() callsites to an advisory emulator bridge so repeated guest hints cannot force ART compacting collections.

Replace timing-specific conversion metadata with a single universal transform version. Existing retained MIDlets reconvert automatically, and future transformer or bridge changes only need to increment that version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant