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 slowly grows over time #1

Open
spitfire55 opened this issue Oct 4, 2019 · 0 comments
Open

Memory slowly grows over time #1

spitfire55 opened this issue Oct 4, 2019 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@spitfire55
Copy link
Collaborator

Because we are lazily reading in the entire JSON log file each time we want to add a new entry, the amount of memory we use also grows with the file.

Instead, Logger.Log(c Connection) should append a new JSON record to the file without reading the entire file in. ioutil.ReadFile(l.fileName) is bad.

Steps to fix:

  1. Remove ioutil.ReadFile(l.fileName)
  2. For each call to Logger.Log, append the JSON as bytes to the file
  3. Make sure to close the file, use mutexes correctly, etc.
@spitfire55 spitfire55 added enhancement New feature or request good first issue Good for newcomers Hacktoberfest Fix this issue to win a free T-Shirt! labels Oct 4, 2019
@spitfire55 spitfire55 removed the Hacktoberfest Fix this issue to win a free T-Shirt! label Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant