Skip to content

garbage collection

1 post with the tag “garbage collection”

Installs fine, runs out of RAM: balancing a Java Card applet suite on the J3R452

Monoid is a set of Java Card applets I work on. Identity holds the card identity, the Secret PIN and the Bundle; Monoid manages keys, data and the Access PIN; Security Key implements FIDO2; an OTP applet that computes TOTP codes came later. The last three share one library package, and they call each other through a Shareable Interface. The suite had already passed its full flow on a D321 card. Moved to a J3R452 (D600), with all four CAP files byte-for-byte identical, LOAD and INSTALL succeeded — and the first Hello came back with an internal error. A diagnostic build named the cause: SystemException.NO_TRANSIENT_SPACE, raised while checking whether a PIN had been set.

This post is what the following rounds of debugging taught me: how Java Card accounts for RAM, why “a power cycle clears RAM” and “there’s plenty left when the command ends” are both unreliable intuitions, which buffers moved to persistent memory, and what it cost when the wrong things moved.