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

Issue: Out of memory error and High CPU usage #2

Merged
merged 1 commit into from Mar 28, 2021

Conversation

MarkRSill
Copy link
Collaborator

I found that once a JSON document was loaded into MemoJSON than the Action List Update calls were checking JSON IsValid continuously causing high CPU usage and when the JSON is valid, the parsed JSON object in IsValid was leaked which quickly leads to an Out of Memory error. The suggested change is to only validate the JSON when MemoJSON has been changed as well as free the leaked TJSONObject in TPkgJsonMapper.IsValid. To test, paste a sizable valid JSON doc in the memo and watch CPU and memory. Out of Memory errors occurred pretty quickly in my testing of sizeable JSON content.
SampleJSON.zip

…U usage and when JSON is valid, the parsed JSON response is leaked leading to Out of Memory error. Suggested change to only validate JSON on MemoJSON changed and free the leaked TJSONObject in TPkgJsonMapper.IsValid. ARC has been deprecated, so instances need to be managed.
@JensBorrisholt JensBorrisholt merged commit 51c4031 into Development Mar 28, 2021
@MarkRSill MarkRSill deleted the Issue-out-of-memory branch March 29, 2021 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants