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 overflow #22

Open
cn17173 opened this issue May 21, 2023 · 3 comments
Open

memory overflow #22

cn17173 opened this issue May 21, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@cn17173
Copy link

cn17173 commented May 21, 2023

There are still more memory leak issues present. Switching from test1.json to test2.json increases memory usage by 0.1MB.

@gcarreno gcarreno self-assigned this May 23, 2023
@gcarreno gcarreno added the bug Something isn't working label May 23, 2023
@gcarreno
Copy link
Owner

Hey @cn17173,

Thanks for the report!!
As soon as I have time, I'll have a go at finding the problem !!

Cheers,
Gus

@cn17173 cn17173 closed this as completed May 25, 2023
@cn17173 cn17173 reopened this May 25, 2023
@cn17173
Copy link
Author

cn17173 commented May 25, 2023

The following two lines of code in the function UpdateTreeFromNode in the unit LJV.Forms.Main may cause memory leaks:
treeNode^.NodeName:=TJSONObject(AJSONData).Names[index];
treeNode^.NodePath:= treeNode^.NodePath + '.' + treeNode^.NodeName;.
lt seems that assigning dynamically allocated string objects to treeNode·.NodeName without releasing the originalobjects may lead to memory leaks. However,l don't know how to modify it.

SetLength(treeNode^.NodeName, 0); SetLength(treeNode^.NodePath, 0); can solve the memory overflow problem, but it will lose the values of NodeName and NodePath.

@gcarreno
Copy link
Owner

Hey @cn17173,

I'm very, VERY grateful for your initial leg work!!!
This will, for sure, narrow my attention and will be quicker !!

Again, sorry I don't have time right now to pursue it, but it's on my todo list and it will not be forgiven!!

Cheers,
Gus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants