Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Lower memory requirements #1205

Closed
nitnelave opened this issue Apr 11, 2023 · 2 comments
Closed

Lower memory requirements #1205

nitnelave opened this issue Apr 11, 2023 · 2 comments

Comments

@nitnelave
Copy link

Issue

Analyzing a create is taking huge amounts of memory. If there is no way around that, it should at least be called out in the docs.

Steps to Reproduce

Clone LLDAP (https://github.com/lldap/lldap).
Run cargo mirai.

Expected Behavior

Diagnostics returned in a reasonable amount of time

Actual Results

10GB of resident memory (12+GB of virtual memory) on a system with 16, and I think issues with swapping.

Environment

rustc 1.67.1 (d5a82bbd2 2023-02-07)
Mirai installed with info: latest update on 2023-03-22, rust version 1.70.0-nightly (1db9c061d 2023-03-21)

@hermanventer
Copy link
Contributor

Static analysis of the kind that MIRAI does is inherently exponential. There are numerous hacks and heuristics for trying to make sure it never happens in practice., but they only go so far. Given a particular instance of exponential behavior it is often possible to resolve it by adding a heuristic. Unfortunately this is extremely complex and time-consuming, so it going to take a while.

One way to work around this in the meanwhile is to figure out which function is causing the analysis to diverge. One you know the culprit, please 1) update this issue with your findings and 2) either just modify the code to make the function into a dummy (when you analyze with MIRAI: cfg!(mirai)) and add a foreign_contracts module with an explicit summary of the function.

@hermanventer
Copy link
Contributor

No updates.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants