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

The memory usage is too high #113

Open
SpaceManiac opened this issue Nov 12, 2019 · 5 comments
Open

The memory usage is too high #113

SpaceManiac opened this issue Nov 12, 2019 · 5 comments

Comments

@SpaceManiac
Copy link
Owner

SpaceManiac commented Nov 12, 2019

language server peaks at 1.1G RSS parsing /tg/station, idles at 580M on glibc and 1.0G on musl despite low utilization

probably heap fragmentation:

  • on glibc, 10% of RSS is overhead
  • on musl, 45% of RSS is overhead

tried throwing away some unnecessary data (bd255d1), which reduces in-use memory by 70% but doesn't reduce RSS at all:

  • on glibc, 73% of RSS is overhead
  • on musl, 85% of RSS is overhead
@SpaceManiac
Copy link
Owner Author

musl changed something and my builds are now hovering at more like 610MB RSS on /tg/station which is a lot closer to acceptable

@SpaceManiac
Copy link
Owner Author

SpaceManiac commented Nov 24, 2020

A recent series of commits has helped significantly. The following comparison is with x86_64-unknown-linux-gnu/debug. x86_64-unknown-linux-musl/release is a little worse both before and after, but the magnitude of the improvement is about the same.

Before, 66d4b82

  • sizeof(Statement) = 664
  • sizeof(Expression) = 192
  • sizeof(Term) = 128
  • langserver idle @ 952 MB
  • lint massif peak @ 859 MB
  • parse 3.877s - references 0.554s - dreamchecker 1.364s - diagnostics 0.008s - total 5.805s

After, 13fd304

  • sizeof(Statement) = 104
  • sizeof(Expression) = 64
  • sizeof(Term) = 88
  • langserver idle @ 533 MB (44% reduction)
  • lint massif peak @ 463 MB (46% reduction)
  • parse 3.474s - references 0.565s - dreamchecker 1.353s - diagnostics 0.006s - total 5.400s

@SpaceManiac
Copy link
Owner Author

Whatever happened to make this worse while I wasn't looking, I fought it off a bit again:

  • sizeof(Statement) = 88
  • sizeof(Expression) = 48
  • sizeof(Term) = 64
  • langserver idle on /tg/station13 from 648 MB to 537 MB

@SpaceManiac
Copy link
Owner Author

  • sizeof(Statement) = 56
  • sizeof(Expression) = 32
  • sizeof(Term) = 40
  • langserver idle on /tg/station13 is 418 MB

@willox
Copy link
Contributor

willox commented Nov 22, 2021

Have you measured the impact from identifiers and string literals? I'm not sure about the strings, but for identifiers there are many savings to potentially be made by sharing the allocation of duplicate names.

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

No branches or pull requests

2 participants