1
\$\begingroup\$

What is the shortest code, in any garbage collected language (including ARC) that produces a memory leak?

It does not matter how much memory is leaked. The shorter the code, and the more deeply nested the implementation languages, the better. Score is calculated by the number of characters times the number of languages within the language's implementation (excluding machine code).

For example:
moonscript => lua => C => assembly, 34 characters.
Score: 136

Edit:

One of the comments points out:

What exactly do you mean by "memory leak"? Under the traditional meaning, memory leaks are impossible in languages like Lua unless you find a bug in the runtime.

Then go find that runtime bug, ;-).

\$\endgroup\$
  • 3
    \$\begingroup\$ What exactly do you mean by "memory leak"? Under the traditional meaning, memory leaks are impossible in languages like Lua unless you find a bug in the runtime. \$\endgroup\$ – Joseph Sible-Reinstate Monica May 31 at 23:30
  • 2
    \$\begingroup\$ Taking a pre-existing challenge and arbitrarily restricting the languages in which an answer is valid does not make it not a duplicate; Voting to leave closed as a duplicate of Leak Memory in as few bytes as possible \$\endgroup\$ – pppery Jun 1 at 17:13
  • \$\begingroup\$ I was not aware of that post. \$\endgroup\$ – Sapphire_Brick Jun 1 at 18:17

Browse other questions tagged or ask your own question.