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

Out of Memory Error during Analysis Step #713

Open
ausetiad opened this issue Mar 26, 2024 · 5 comments
Open

Out of Memory Error during Analysis Step #713

ausetiad opened this issue Mar 26, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@ausetiad
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Using CLI, perform baseline scan and another scan - "./Asa collect -CdlfFkpPsuwh —runid" (following instructions here https://github.com/microsoft/AttackSurfaceAnalyzer/wiki/CLI-Walkthrough)
  2. Run "asa export-collect --outputsarif"
  3. See error: "Out of memory.
    zsh: abort ./Asa export-collect --outputsarif --lowmemoryusage"

Expected behavior
I expect the analysis to be performed as explained in the walkthroug

Screenshots
If applicable, add screenshots to help explain your problem.
image

System Configuration (please complete the following information):

Additional Context

@ausetiad ausetiad added the bug Something isn't working label Mar 26, 2024
@ausetiad ausetiad changed the title Your Bug Title Here Out of Memory Error during Analysis Step Mar 26, 2024
@gfs
Copy link
Contributor

gfs commented Mar 27, 2024

Thanks for the report. I'll try to reproduce this and see if there's anything that can be done to reduce memory during the analysis step.

To give me some hints about how to best repro this. Can you share how much memory your system has, how large the total asa.sqlite dbs you've collected are and, if you know, how much memory is being consumed when you hit the out of memory error?

@ausetiad
Copy link
Author

@gfs

Machine is a 2023 Mac Studio, Apple M2 Max chip with 32GB of memory.

How do I collect the following information: how large the total asa.sqlite dbs you've collected are and, if you know, how much memory is being consumed when you hit the out of memory error?

@gfs
Copy link
Contributor

gfs commented Mar 27, 2024

@ausetiad

  1. Size of databases: Look in the directory you're executing asa in and check the sizes of the asa.sqlite files
  2. Memory usage: Open Activity Monitor while executing ASA and watch the memory usage statistic.

You can also try to re-run export collect with --disableimplicitfindings which may reduce memory usage. Based on the output messages I think the out of memory is hit during construction of the sarif output file - removing implicit findings should reduce the size of that file.

@ausetiad
Copy link
Author

Sizes of asa.sqlite files:

  • asa.sqlite - 14.68 GB
  • asa.sqlite_1 - 14.64 GB
  • asa.sqlite_2 - 14.65 GB
  • asa.sqlite_3 - 14.7 GB
  • asa.sqlite_4 - 14.65 GB
  • asa.sqlite_5 - 14.62 GB
  • asa.sqlite_6 - 14.66 GB

I'm going to try and get the memory usage info while running export collect with --disableimplicitfindings enabled

@gfs
Copy link
Contributor

gfs commented May 2, 2024

After further investigation the root cause of this appears to be that every file was reporting a different content hash between collection runs - but with no other changes resulting in a hugely inflated report. I am as of yet unable to repro this on a mac myself.

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