[2.0.10:] Memory leaks when clone Array or Map obj Topic is solved

Report problems with documented functionality
User avatar
V2User
Posts: 195
Joined: 30 Apr 2021, 04:04

[2.0.10:] Memory leaks when clone Array or Map obj

26 Nov 2023, 12:00

Memory leaks when clone Array obj.
This code below will lead to serious memory leaks:

Code: Select all

loop{
	c:=[1,2,3].Clone()
}
image.png
image.png (144.09 KiB) Viewed 1066 times
The memory will instantly increase from 2MB to 50MB in several minutes. Normally, it should always be 2.0 MB like any other.
Last edited by V2User on 09 Dec 2023, 00:28, edited 2 times in total.
Descolada
Posts: 1196
Joined: 23 Dec 2021, 02:30

Re: [2.0.10:] Memory leaks when clone Array obj

26 Nov 2023, 14:53

Confirmed in AHK v2.0.10. Seems to be related to Object::SetInternalCapacity not accounting for field_count of 0.
User avatar
V2User
Posts: 195
Joined: 30 Apr 2021, 04:04

Re: [2.0.10:] Memory leaks when clone Array obj

26 Nov 2023, 23:13

Thanks for your great work. you all.
User avatar
V2User
Posts: 195
Joined: 30 Apr 2021, 04:04

Re: [2.0.10:] Memory leaks when clone Array obj

08 Dec 2023, 02:55

The same happens to Map objects.
User avatar
V2User
Posts: 195
Joined: 30 Apr 2021, 04:04

Re: [2.0.10:] Memory leaks when clone Array or Map obj

23 Dec 2023, 01:31

Great work! :+1:
Thanks very much again for giving us this great language! :+1:

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 6 guests