-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
reduce 1.5x memory usage on large repos on repeated runs #764
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
Conversation
Get rid of AST cache: load AST when needed. Optimize memory allocations for go/analysis actions. Relates: #337
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
BTW still getting OOM'ed on kubernetes codebase :(
Showing nodes accounting for 4195.99MB, 72.50% of 5787.34MB total
Dropped 328 nodes (cum <= 28.94MB)
Showing top 10 nodes out of 150
flat flat% sum% cum cum%
2838.82MB 49.05% 49.05% 2911.32MB 50.31% honnef.co/go/tools/ssa.memberFromObject
260.05MB 4.49% 53.55% 958.12MB 16.56% honnef.co/go/tools/ssa.makeWrapper
254.66MB 4.40% 57.95% 275.16MB 4.75% go/types.methodSet.add
156.67MB 2.71% 60.65% 485.84MB 8.39% go/types.NewMethodSet
134.01MB 2.32% 62.97% 134.01MB 2.32% go/types.(*Selection).Type
119.79MB 2.07% 65.04% 119.79MB 2.07% golang.org/x/tools/go/types/typeutil.Hasher.Hash
118.60MB 2.05% 67.09% 118.60MB 2.05% go/types.(*Checker).recordTypeAndValue
109.15MB 1.89% 68.97% 1071.27MB 18.51% honnef.co/go/tools/ssa.(*Program).addMethod
105.71MB 1.83% 70.80% 105.71MB 1.83% bytes.makeSlice
98.52MB 1.70% 72.50% 98.52MB 1.70% honnef.co/go/tools/ssa.(*Function).newBasicBlock
inuse:
1582.61MB 51.06% 51.06% 1634.11MB 52.72% honnef.co/go/tools/ssa.memberFromObject
199.08MB 6.42% 57.48% 199.08MB 6.42% bytes.makeSlice
87.07MB 2.81% 60.29% 87.07MB 2.81% go/types.(*Checker).recordTypeAndValue
80.52MB 2.60% 62.89% 306.54MB 9.89% honnef.co/go/tools/ssa.makeWrapper
63.03MB 2.03% 64.92% 69.03MB 2.23% go/types.methodSet.add
53.50MB 1.73% 66.65% 53.50MB 1.73% honnef.co/go/tools/ssa.NewConst
49.60MB 1.60% 68.25% 49.60MB 1.60% golang.org/x/tools/go/types/typeutil.Hasher.Hash
44.50MB 1.44% 69.68% 44.50MB 1.44% go/types.NewParam
42.72MB 1.38% 71.06% 42.72MB 1.38% go/scanner.(*Scanner).scanString
40.03MB 1.29% 72.35% 122.06MB 3.94% go/types.NewMethodSet
pprof.golangci-lint.alloc_objects.alloc_space.inuse_objects.inuse_space.004.pb.gz
@ernado did you try disabling |
@jirfag I've tried right now, and it is much better:
So just 1.5Gb RSS, very cool. |
It's good. We need to add information about |
Get rid of AST cache: load AST when needed. Optimize memory allocations
for go/analysis actions.
Relates: #337