lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I believe this issue happens in 'normal' tables as well.
>
> I've managed to reproduce this issue in both Lua 5.3 and Lua 5.4-work2
> and could isolate this to a simple C code. The memory allocation
> pattern in both version is pretty different, probably thanks to the
> new GC in 5.4.
>
> This code [1] will grow the memory steadily and will exhaust the
> computer memory given enough iterations.
>
> In my 8GB machine, this happened in 11 seconds when compiled with 5.3.
>
> [2][3] both show the memory allocation pattern using massif from valgrind.
>
> [1] https://pastebin.com/KCsHduKB
> [2] https://pastebin.com/p2b6NE0Q
> [3] https://pastebin.com/3hEkk2j9

Playing a little bit more with the issue above I've stumbled upon an
interesting result. It seems that references to strings does not
reproduce the issue. The code is show in [1]. Valgrind's massif
reports the expected result, a constant usage of the memory [2].

[1] https://pastebin.com/C9p3EVfv
[2] https://pastebin.com/4Tdg4jUg