Open joysahimar opened 3 months ago
Hi, i have a function that has a closure. However, when I run it with a loop, I see the memory is very high. ~700mb on my linux.
Code :
fn foo(i int) fn () int { return fn [i]() int { return i } } fn main() { for i in 0 .. 100000000 { println(foo(i)()) } }
Run :
v run main.v
look at app monitor.
<1mb memroy usage.
~700mb memory usage
No response
V 0.4.4 7ffd917
V full version: V 0.4.4 790ea2f.7ffd917 OS: linux, Pop!_OS 20.04 LTS Processor: 4 cpus, 64bit, little endian, Intel(R) Core(TM) i3-4030U CPU @ 1.90GHz
[!NOTE] You can use the 👍 reaction to increase the issue's priority for developers. Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.
[!NOTE] You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.
This may have been introduced by this commit: 26d051475ac3a33031eec1936e813dc3f088d2fb
Describe the bug
Hi, i have a function that has a closure. However, when I run it with a loop, I see the memory is very high. ~700mb on my linux.
Reproduction Steps
Code :
Run :
look at app monitor.
Expected Behavior
<1mb memroy usage.
Current Behavior
~700mb memory usage
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.4 7ffd917
Environment details (OS name and version, etc.)
V full version: V 0.4.4 790ea2f.7ffd917 OS: linux, Pop!_OS 20.04 LTS Processor: 4 cpus, 64bit, little endian, Intel(R) Core(TM) i3-4030U CPU @ 1.90GHz