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

Reduced memory usage of DetectInfo/EvtxRecordInfo #837

Merged
merged 4 commits into from
Dec 19, 2022

Conversation

fukusuket
Copy link
Collaborator

@fukusuket fukusuket commented Dec 18, 2022

What Changed

Evidence

I got the benchmark with this environment and procedure.

-P standard

Reduced memory usage about 0.3GiB(heap stats: peak/reserved)
e873adf (mainブランチ)

Elapsed time: 00:13:05.192
Saved file: 1.csv (574.8 MB)

Memory usage stats:
heap stats:    peak      total      freed    current       unit      count
  reserved:    5.6 GiB    5.6 GiB   56.0 MiB    5.5 GiB                        not all freed!
 committed:    4.9 GiB    6.6 GiB    1.8 GiB    4.8 GiB                        not all freed!

8591a97 (修正後)

Elapsed time: 00:12:43.371
Saved file: 1.csv (574.8 MB)

Memory usage stats:
heap stats:    peak      total      freed    current       unit      count
  reserved:    5.3 GiB    5.3 GiB   56.0 MiB    5.2 GiB                        not all freed!
 committed:    4.6 GiB    5.9 GiB    1.4 GiB    4.5 GiB                        not all freed!

-P super-verbose

Reduced memory usage about 0.2GiB (heap stats: peak/reserved)
e873adf (mainブランチ)

Elapsed time: 00:13:18.908
Saved file: 1.csv (2.2 GB)

Memory usage stats:
heap stats:    peak      total      freed    current       unit      count
  reserved:    9.1 GiB    9.1 GiB   56.0 MiB    9.0 GiB                        not all freed!
 committed:    8.4 GiB   11.2 GiB    2.9 GiB    8.3 GiB                        not all freed!

8591a97 (修正後)

Elapsed time: 00:13:07.431
Saved file: 1.csv (2.2 GB)

Memory usage stats:
heap stats:    peak      total      freed    current       unit      count
  reserved:    8.9 GiB    8.9 GiB   56.0 MiB    8.8 GiB                        not all freed!
 committed:    8.2 GiB   11.0 GiB    2.8 GiB    8.2 GiB                        not all freed!

Test

About the above command execution(-P standard/-P super-verbose) results, I have confirmed following points.

  • Same number of detections before and after fix. (ref: results.zip)
  • There is no diffs in the output.csv(after sorted)

I would appreciate it if you could review🙏

…elds

- EvtxRecordInfo.record_information
- DetectInfo.record_information
- refactor: be clear variable name(details_fmt_str)
@fukusuket fukusuket changed the title Reduced memory usage for DetectInfo/EvtxRecordInfo Reduced memory usage for DetectInfo/EvtxRecordInfo Dec 18, 2022
@YamatoSecurity YamatoSecurity added the enhancement New feature or request label Dec 18, 2022
Copy link
Collaborator

@hitenkoku hitenkoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fukusuket fukusuket changed the title Reduced memory usage for DetectInfo/EvtxRecordInfo Reduced memory usage of DetectInfo/EvtxRecordInfo Dec 18, 2022
Copy link
Collaborator

@YamatoSecurity YamatoSecurity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. ありがとうございました!

@YamatoSecurity YamatoSecurity merged commit 5f24c54 into main Dec 19, 2022
@hitenkoku hitenkoku deleted the dev-improve-memory-performance branch December 19, 2022 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants