Skip to content

OOM heap crash with -d or -w, and --noImplicitThis #29902

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

Closed
dasa opened this issue Feb 13, 2019 · 2 comments · Fixed by #31586
Closed

OOM heap crash with -d or -w, and --noImplicitThis #29902

dasa opened this issue Feb 13, 2019 · 2 comments · Fixed by #31586
Assignees
Labels
Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented. Suggestion An idea for TypeScript

Comments

@dasa
Copy link

dasa commented Feb 13, 2019

TypeScript Version: 3.2 - 3.4.0-dev.20190213

Search Terms:
memory heap crash

Code

function createObj() {
  return {
    func1() {
      return this;
    },
    func2() {
      return this;
    },
    func3() {
      return this;
    },
    func4() {
      return this;
    },
    func5() {
      return this;
    },
    func6() {
      return this;
    },
    func7() {
      return this;
    },
    func8() {
      return this;
    },
    func9() {
      return this;
    }
  };
}

Expected behavior:

Run: tsc --noImplicitThis -d test.ts

No crash. There's no crash when there's only 8 functions, but the generated declaration file is 41 MB!

Actual behavior:

With 9 member functions tsc runs out of memory and crashes.

Playground Link:

Related Issues:

@dasa dasa changed the title OOM heap crash with -d or -w OOM heap crash with -d or -w, and --noImplicitThis Feb 13, 2019
@RyanCavanaugh
Copy link
Member

Here's the 3-member version .d.ts output for reference:

declare function createObj(): {
    func1(): {
        func1(): any;
        func2(): {
            func1(): any;
            func2(): any;
            func3(): {
                func1(): any;
                func2(): any;
                func3(): any;
            };
        };
        func3(): {
            func1(): any;
            func2(): {
                func1(): any;
                func2(): any;
                func3(): any;
            };
            func3(): any;
        };
    };
    func2(): {
        func1(): {
            func1(): any;
            func2(): any;
            func3(): {
                func1(): any;
                func2(): any;
                func3(): any;
            };
        };
        func2(): any;
        func3(): {
            func1(): {
                func1(): any;
                func2(): any;
                func3(): any;
            };
            func2(): any;
            func3(): any;
        };
    };
    func3(): {
        func1(): {
            func1(): any;
            func2(): {
                func1(): any;
                func2(): any;
                func3(): any;
            };
            func3(): any;
        };
        func2(): {
            func1(): {
                func1(): any;
                func2(): any;
                func3(): any;
            };
            func2(): any;
            func3(): any;
        };
        func3(): any;
    };
};

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Feb 19, 2019
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.5.0 milestone Feb 19, 2019
@RyanCavanaugh
Copy link
Member

I am determined to let the 9-member version of this run to completion on my machine (36 minutes and counting)

@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented. and removed Bug A bug in TypeScript labels Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented. Suggestion An idea for TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants