Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak in Array_Implementation.cs #3

Open
tatelax opened this issue Sep 9, 2021 · 1 comment
Open

Memory Leak in Array_Implementation.cs #3

tatelax opened this issue Sep 9, 2021 · 1 comment

Comments

@tatelax
Copy link

tatelax commented Sep 9, 2021

FYI for anyone who cares:

This line is setting the value to null in the Object array called data. This doesn't actually remove the element from the array, it just sets it to null. If you were to actually use this code, memory would only increase because when you call delete(), it doesn't free up anything.

The way to solve this in C# would be to create an entirely new array with a length of -1 from the original array.

@anirban-s
Copy link
Owner

Please create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants