s2e-env icon indicating copy to clipboard operation
s2e-env copied to clipboard

Profile S2E's memory usage and identify what can be optimized

Open humeafo opened this issue 6 years ago • 4 comments

I encountered a weird situation in S2E that with only two alive states but S2E consumed 20GB+ memory, there were some states killed this before, and some symbolic data introduced(say less than 30MB), I know there're some leaks such as klee's symbolic array etc, but should not consume this much, there must be some other big leak sources, how do you profile S2E's memory usage? Any advice on this?

humeafo avatar Jun 27 '18 13:06 humeafo

There are some hints here: http://s2e.systems/docs/src/ProfilingS2E.html

You could also recompile S2E with a malloc library that supports profiling. There should be a few out there.

30MB of symbolic data is huge btw. What are you trying to do?

vitalych avatar Jun 28 '18 10:06 vitalych

Thanks for the info. 30MB is accumulated size of many symbolic input data in many states, not a single input data in one state, all of the states (except one) were killed, but the memory consumption is still there.

humeafo avatar Jun 28 '18 12:06 humeafo

This is a very good issue, reopening it.

vitalych avatar Jun 28 '18 16:06 vitalych

Some ideas:

  • Check how many memory pages are duplicated across states => could justify implementing deduplication
  • Check heap fragmentation (could explain why memory usage doesn't seem to go down)
  • Related issues: #92, #333, #341

vitalych avatar Jun 28 '18 16:06 vitalych