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

2.6 takes a very long time to --watch on large projects #19253

Closed
JoshuaKGoldberg opened this issue Oct 17, 2017 · 5 comments · Fixed by #19306
Closed

2.6 takes a very long time to --watch on large projects #19253

JoshuaKGoldberg opened this issue Oct 17, 2017 · 5 comments · Fixed by #19306
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue High Priority

Comments

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Oct 17, 2017

TypeScript Version: 2.6.0-rc

Code

# Where tsconfig.json includes hundreds of .ts files (~400 on my smallest repro project)
tsc -w tsconfig.json
{
    "compilerOptions": {
        "declaration": true,
        "experimentalDecorators": true,
        "jsx": "react",
        "noImplicitAny": true,
        "noImplicitReturns": true,
        "noImplicitThis": true,
        "noResolve": true,
        "pretty": true,
        "sourceMap": true,
        "target": "es5"
    },
    "include": [...]
}

Expected behavior:

After adding an unused public method to a class, it should eventually finish compilation.

Actual behavior:

After >10 minutes of waiting a few times, I've terminated the process. I've also tried reinstalling 2.6.0-rc.

Side note: on a smaller project of 28 items, with identical tsconfig settings (except that strictNullChecks is on), recompilation from adding an unused public method to a class went from ~1000ms average over 5 runs to 1500ms average (measured from the time TS outputs the File_change_detected_Starting_incremental_compilation diagnostic to the time it outputs the Compilation_complete_Watching_for_file_changes diagnostic).

The code isn't open source so I can't post it here, but I have emailed a few TypeScript team members instructions on how to get to it before (Office Sway).

@mhegazy mhegazy added the Bug A bug in TypeScript label Oct 17, 2017
@mhegazy mhegazy added this to the TypeScript 2.6.1 milestone Oct 17, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Oct 17, 2017

@JoshuaKGoldberg can you share the project info with @sheetalkamat and myself?

@JoshuaKGoldberg
Copy link
Contributor Author

Sure!

Also, sure enough, right after I posted this issue, two long-running watchers ended up in out-of-memory heap failures.

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

@tolgaek
Copy link

tolgaek commented Dec 22, 2017

I'm experiencing same error with v2.6.2. It only seems to happen after a file has changed

@aldendaniels
Copy link

Also experiencing this issue. Added comment to related issue #19662

@mhegazy
Copy link
Contributor

mhegazy commented Jan 10, 2018

@aldendaniels please file a new issue and give us more information to help diagnose the issue. ideally a sample project.

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue High Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants