Skip to content

What are the pros and cons of using the Garbage Collector in Nelua? #166

Answered by edubart
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

Well, the garbage collector makes life easier when prototyping code quickly, because you don't need to care about cleaning memory allocations when it's not used anymore, it also may protect you from programming mistakes because manual memory management can be difficult and it is common to make mistakes. However, the payoff is runtime cost in terms of efficiency and memory, because the program may pause a while to scan the whole memory for references that are not referenced anymore (to free its memory). Here are some lists of advantages and disadvantages, though this topic is popular and you can also research on the web:

Advantages of using GC:

  • No need to cleanup new allocations (because …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by edubart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant