We're a place where coders share, stay up-to-date and grow their careers.
Will this cause a memory leak if it's run indefinitely?
@asolace I don't think so, all the variables are initialized inside the tellTime function. So, they should be used only when the program runs after each instance. Once the function ends, the garbage collector should remove them from the heap.
tellTime
stackoverflow.com/questions/140341...
@asolace @alexandrusimandi updated the post ranvir.xyz/blog/running-a-function... with the answer to the memory leak. Hope it helps.
Will this cause a memory leak if it's run indefinitely?
@asolace I don't think so, all the variables are initialized inside the
tellTime
function. So, they should be used only when the program runs after each instance. Once the function ends, the garbage collector should remove them from the heap.stackoverflow.com/questions/140341...
@asolace @alexandrusimandi updated the post ranvir.xyz/blog/running-a-function... with the answer to the memory leak. Hope it helps.