Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Allocated memory bloat on project build attempt (yarn build) #158

Closed
kuzhelov opened this issue Aug 29, 2018 · 3 comments
Closed

Allocated memory bloat on project build attempt (yarn build) #158

kuzhelov opened this issue Aug 29, 2018 · 3 comments
Labels
vsts Paired with ticket in vsts

Comments

@kuzhelov
Copy link
Contributor

kuzhelov commented Aug 29, 2018

Bug Report

Steps

Expected Result

Build suceeds

Actual Result

Build fails with the following problem

image

@kuzhelov
Copy link
Contributor Author

kuzhelov commented Aug 29, 2018

Key takeaways

  • major impact is provided by enabled strictNullCheck TS compiler flag
    • skipLibCheck, skipDefaultLibCheck, noStrictGenericChecks
  • while yes, we can fix types for this PR and 'resolve' CI build issue for it, with that we will effectively agree that stability of our build infrastructure is dependent on the code we are providing in sources (?!)
  • introduce larger allocation size limits helps, but only for the case where 'strictNullCheck' is disabled

Proposed solutions/mitigation strategies

Details

Here are the results from the investigation process held by me and @miroslavstastny. Essentially, the following approaches were tries to solve the problem (results from all of them were subsequently monitored by running process with trace_gc flag):

  • increase memory size available for heap allocation (max_old_space_size flag)
    • although memory size was increased, this move haven't resulted in problem being solved: all the available space was consumed by build tasks (docs + sources, simultaneously), and subsequent allocation requests fail. Worth to notice that gradient of allocation size growth is quite impressive - we do not even reaching plato at this point
  • our next thought was about problems with build process pipeline. We've tried to limit amount of concurrently running tasks, the simplest move - to make sources and docs run sequentially. This hasn't solved the problem or made any effect on amount of memory consumed
  • next thing that has been tried - remove strictNullCheck flag from TS compiler config. This has resulted in much moderate memory consumption by the compiler, with even default threshold being never exceeded (irregardless of whether sources were built in parallel with docs or not)

cc: @levithomason, @miroslavstastny

@kuzhelov
Copy link
Contributor Author

kuzhelov commented Aug 29, 2018

as problem is reproing only for docs build, maybe it makes sense to apply disabled strictNullChecks flag only for the docs files? However, problem's scope should be strictly defined first..

@kuzhelov kuzhelov reopened this Aug 29, 2018
@kuzhelov kuzhelov changed the title Allocated memory bloat on project build attempt (yarn build) [BUG] Allocated memory bloat on project build attempt (yarn build) Aug 30, 2018
@kuzhelov kuzhelov changed the title [BUG] Allocated memory bloat on project build attempt (yarn build) Allocated memory bloat on project build attempt (yarn build) Aug 30, 2018
@alinais alinais added the vsts Paired with ticket in vsts label Sep 3, 2018
@kuzhelov
Copy link
Contributor Author

kuzhelov commented Sep 7, 2018

will be addressed and tracked by #184, closing

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

No branches or pull requests

2 participants