ID:2860409
 
Resolved
The result of json_encode() had too high a reference count, resulting in memory leaks.
BYOND Version:515.1602
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Chrome 108.0.0.0
Applies to:Dream Daemon
Status: Resolved (515.1603)

This issue has been resolved.
Descriptive Problem Summary:
json_encode in the following code snippet seems to be hanging on to strings, leading to an ever growing string tree.

Numbered Steps to Reproduce Problem:
1. run code
2. view memory stats.
3. look for str line in the top section.

Code Snippet (if applicable) to Reproduce Problem:
    for (var/i in 1 to 1000)
for (var/k in 1 to 1000)
. = json_encode(list("i" = "[i]", "k" = "[k]"))

world.log << .


Expected Results: (514)
    str: 24.9 KB (628)


Actual Results: (515)
    str: 51.8 MB (1,046,037)



Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Happens in 515.1602.
Happens in 515.1600.
Happens in 515.1599.
Happens in 515.1590.

Does not happen in 514.1589
Lummox JR resolved issue with message:
The result of json_encode() had too high a reference count, resulting in memory leaks.