Skip to content

Commit 031a5ca

Browse files
committed
docs: say that a local variable keeps its object reachable until the method returns
1 parent a749c46 commit 031a5ca

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎docs/support.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ java-web targets headless Java: console apps, libraries and javac.
5656
fields back to it (JS cannot finalize such an object): the VM drops the
5757
finalizer of an object it finds on such a cycle, so the object is freed
5858
without `finalize()` running, and a cycle it does not find (a class loader
59-
with a `finalize()`) keeps the object for good. In the browser `System.gc()` is a hint and the engine collects when it chooses.
59+
with a `finalize()`) keeps the object for good. A local variable keeps its
60+
object reachable until the method returns or the variable is overwritten,
61+
even after its last use, so such an object is cleared or finalized later
62+
than on HotSpot. In the browser `System.gc()` is a hint and the engine collects when it chooses.
6063
- Not supported: GUI apps (AWT and Swing windows), `ConvolveOp`, child
6164
processes in the browser, and native libraries other than JS natives.
6265

0 commit comments

Comments
 (0)