<#19060 High memory usage spinning up Pants on cle...
# github-notifications
c
#19060 High memory usage spinning up Pants on clean Go monorepo Issue created by ImprintNav Describe the bug Upon performing a compile-check against a clean checkout of our Go repo with roughly 1000000 lines of Go code and 7690 Go files, the Pants daemon ends up consuming a peak of roughly 15 GiB of memory before cooling off. The operation also takes much longer than
go build ./...
. Pants version 2.17.0.dev5 OS MacOS ARM64 Additional info When running
-ldebug
, I notice that Go modules keep getting refetched over and over again. I don't think the daemon is actually dying this time around so it's unclear why this is happening. Result of
pants check --stats-memory-summary ::
(omitted ldebug due to size and privacy for now) ``` 133150.47 [INFO] Memory summary (total size in bytes, count, name): 48 1 pants.backend.go.dependency_inference.AllGoModuleImportPathsMappings 48 1 pants.backend.go.dependency_inference.GoModuleImportPathsMapping 48 1 pants.backend.go.dependency_inference.GoModuleImportPathsMappings 48 1 pants.backend.go.goals.check.GoCheckRequest 48 1 pants.backend.go.subsystems.golang.GolangSubsystem 48 1 pants.backend.go.subsystems.golang.GolangSubsystem.EnvironmentAware 48 1 pants.backend.go.subsystems.gotest.GoTestSubsystem 48 1 pants.backend.go.target_type_rules.FirstPartyGoModuleImportPathsMappingsHook 48 1 pants.backend.go.target_type_rules.GenerateTargetsFromGoModRequest 48 1 pants.backend.go.target_type_rules.GoImportPathMappingRequest 48 1 pants.backend.go.util_rules.build_pkg.CheckForGolangAssemblyRequest 48 1 pants.backend.go.util_rules.build_pkg.CheckForGolangAssemblyResult 48 1 pants.backend.go.util_rules.build_pkg.SetupAsmCheckBinary 48 1 pants.backend.go.util_rules.build_pkg_target._ResolveStdlibEmbedConfigRequest 48 1 pants.backend.go.util_rules.build_pkg_target._ResolveStdlibEmbedConfigResult 48 1 pants.backend.go.util_rules.cgo.CGoCompilerWrapperScript 48 1 pants.backend.go.util_rules.cgo_binaries.CGoBinaryPathRequest 48 1 pants.backend.go.util_rules.go_bootstrap.GoBootstrap 48 1 pants.backend.go.util_rules.goroot.GoRoot 48 1 pants.backend.go.util_rules.implicit_linker_deps.SdkImplicitLinkerDependenciesHook 48 1 pants.backend.go.util_rules.link.LinkerSetup 48 1 pants.backend.go.util_rules.link_defs.ImplicitLinkerDependencies 48 1 pants.backend.go.util_rules.pkg_analyzer.PackageAnalyzerSetup 48 1 pants.backend.go.util_rules.sdk.GoSdkRunSetup 48 1 pants.backend.go.util_rules.third_party_pkg.AllThirdPartyPackages 48 1 pants.backend.go.util_rules.third_party_pkg.AllThirdPartyPackagesRequest 48 1 pants.backend.go.util_rules.third_party_pkg.ModuleDescriptors 48 1 pants.backend.go.util_rules.third_party_pkg.ModuleDescriptorsRequest 48 1 pants.backend.project_info.filter_targets.FilterSubsystem 48 1 pants.backend.python.goals.lockfile.PythonSyntheticLockfileTargetsRequest 48 1 pants.backend.python.subsystems.setup.PythonSetup 48 1 pants.base.build_root.BuildRoot 48 1 pants.build_graph.build_configuration.BuildConfiguration 48 1 pants.core.goals.check.Check 48 1 pants.core.goals.check.CheckResults 48 1 pants.core.goals.check.CheckSubsystem 48 1 pants.core.util_rules.distdir.DistDir 48 1 pants.core.util_rules.environments.AllEnvironmentTargets 48 1 pants.core.util_rules.environments.DockerPlatformFieldDefaultFactoryRequest 48 1 pants.core.util_rules.environments.EnvironmentNameRequest 48 1 pants.core.util_rules.environments.EnvironmentTarget 48 1 pants.core.util_rules.environments.EnvironmentsSubsystem 48 1 pants.core.util_rules.search_paths.ValidateSearchPathsRequest 48 1 pants.core.util_rules.search_paths.ValidatedSearchPaths 48 1 pants.core.util_rules.system_binaries.BashBinary 48 1 pants.core.util_rules.system_binaries.BinaryPath 48 1 pants.engine.console.Console 48 1 pants.engine.env_vars.PathEnvironmentVariable 48 1 pants.engine.environment.ChosenLocalEnvironmentName 48 1 pants.engine.fs.Workspace 48 1 pants.engine.internals.build_files.BuildFileOptions 48 1 pants.engine.internals.dep_rules.MaybeBuildFileDependencyRulesImplementation 48 1 pants.engine.internals.graph.ResolveTargetGeneratorRequests 48 1 pants.engine.internals.graph.ResolvedTargetGeneratorRequests 48 1 pants.engine.internals.graph.SubprojectRoots 48 1 pants.engine.internals.mapper.SpecsFilter 48 1 pants.engine.internals.options_parsing._Options 48 1 pants.engine.internals.parser.BuildFilePreludeSymbols 48 1 pants.engine.internals.parser.Parser 48 1 pants.engine.internals.synthetic_targets.AllSyntheticAddressMaps 48 1 pants.engine.platform.Platform 48 1 pants.engine.target.FieldDefaultFactoryResult 48 1 pants.engine.target.FieldDefaults 48 1 pants.engine.target.GeneratedTargets 48 1 pants.engine.target.RegisteredTargetTypes 48 1 pants.engine.target.TargetTypesToGenerateTargetsRequests 48 1 pants.engine.unions.UnionMembership 48 1 pants.goal.anonymous_telemetry.AnonymousTelemetry 48 1 pants.goal.anonymous_telemetry.AnonymousTelemetryCallbackFactoryRequest 48 1 pants.goal.stats_aggregator.StatsAggregatorCallbackFactoryRequest 48 1 pants.goal.stats_aggregator.StatsAggregatorSubsystem 48 1 pants.init.bootstrap_scheduler.BootstrapStatus 48 1 pants.option.global_options.GlobalOptions 48 1 pants.option.global_options.KeepSandboxes 48 1 pants.option.global_options.UnmatchedBuildFileGlobs 48 2 pants.engine.env_vars.CompleteEnvironmentVars 48 5 pants.base.specs.Specs 48 30746 pants.engine.environment.EnvironmentName 56 1 pants.backend.go.util_rules.go_mod.AllGoModTargets 64 1 pants.engine.streaming_workunit_handler.WorkunitsCallbackFactories 88 1 builtins.ProcessExecutionEnvironment 96 2 pants.backend.go.go_sources.load_go_binary.LoadedGoBinary 96 2 pants.backend.go.go_sources.load_go_binary.LoadedGoBinaryRequest 96 2 pants.backend.go.util_rules.build_pkg.RenderEmbedConfigRequest 96 2 pants.backend.go.util_rules.build_pkg.RenderedEmbedConfig 96 2 pants.backend.go.util_rules.cgo.CGoCompileRequest 96 2 pants.backend.go.util_rules.cgo.CGoCompileResult 96 2 pants.backend.go.util_rules.cgo.SetupCompilerCmdRequest 96 2 pants.backend.go.util_rules.cgo.SetupCompilerCmdResult 96 2 pants.backend.go.util_rules.go_mod.GoModInfo 96 2 pants.backend.go.util_rules.go_mod.GoModInfoRequest 96 2 pants.backend.go.util_rules.import_analysis.GoStdLibPackages 96 2 pants.backend.go.util_rules.import_analysis.GoStdLibPackagesRequest 96 2 pants.backend.go.util_rules.link.LinkGoBinaryRequest 96 2 pants.backend.go.util_rules.link.LinkedGoBinary 96 2 pants.engine.internals.graph.Owners 96 2 pants.engine.internals.graph.OwnersRequest 96 2 pants.engine.streaming_workunit_handler.WorkunitsCallbackFactory 144 1 (native) session_values 144 3 pants.backend.go.util_rules.build_pkg.BuiltGoPackage 144 3 pants.backend.go.util_rules.cgo.CheckCompilerSupportsFlagRequest 144 3 pants.backend.go.util_rules.cgo.CheckCompilerSupportsOptionResult 144 3 pants.backend.go.util_rules.sdk.GoSdkToolIDRequest 144 3 pants.backend.go.util_rules.sdk.GoSdkToolIDResult 144 3 pants.base.specs.RawSpecsWithOnlyFileOwners 144 3 pants.core.util_rules.system_binaries.BinaryPathRequest 144 3 pants.core.util_rules.system_binaries.BinaryPaths 144 3 pants.engine.env_vars.EnvironmentVars 144 3 pants.engine.env_vars.EnvironmentVarsRequest 273 1 (native) construct_scope_ 273 1 (native) construct_scope_anonymous_telemetry 273 1 (native) construct_scope_check 273 1 (native) construct_scope_environments_preview 273 1 (native) construct_scope_filter 273 1 (native) construct_scope_go_test 273 1 (native) construct_scope_golang 273 1 (native) construct_scope_python 273 1 (native) construct_scope_stats 273 1 (native) pants.backend.go.util_rules.cg… pantsbuild/pants