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

[BUG] High Memory Usage #65

Closed
2xic opened this issue Aug 31, 2023 · 2 comments
Closed

[BUG] High Memory Usage #65

2xic opened this issue Aug 31, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@2xic
Copy link
Collaborator

2xic commented Aug 31, 2023

Describe the Bug

Certain contracts use a lot of memory.

Setup

  • Tested through the CLI (release build) and verified with a test in SLA library directly.
  • CLI is run with maximum_iterations_per_opcode=10 and maximum_forks_per_fork_target=25

To Reproduce

Steps to reproduce the behavior:

Run one of the following contracts

MeTokenRegistryFacet

Below is the memory usage over time, it can be seen it maxes out at ~7.5gb.

MeTokenRegistryFacet

CapsulesTypeface

Below is the memory usage over time, it can be seen it maxes out at ~4.8gb.

CapsulesTypeface

BorrowLogic

Below is the memory usage over time, it can be seen it maxes out at ~3gb.

BorrowLogic

CpuFrilessVerifier

Below is the memory usage over time, it can be seen it maxes out at ~2.5gb.

CpuFrilessVerifier

Expected Behaviour

Less memory to be used.

@2xic 2xic added the bug Something isn't working label Aug 31, 2023
@iamrecursion
Copy link
Contributor

This is mitigated by #66, but further improvements will require more in-depth refactors and profiling.

@iamrecursion iamrecursion changed the title [BUG] High memory usage [BUG] High Memory Usage Aug 31, 2023
@iamrecursion
Copy link
Contributor

To an extent, however, the memory usage is expected. The memory (m) used by the analyzer is a function of the number of values (n) and the complexity of those values (c), which is dependent on the contract as follows:

$$ \text{m} \propto n \cdot c $$

While there are refactors that can be done to reduce the "memory load" of each individual value, this fundamental relation will still remain.

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

3 participants