Skip to content

Extra long code compilation whitch finished with "memory leak" report after ~20min #42937

Description

This issue started here: TypeStrong/fork-ts-checker-webpack-plugin#569

Current behavior

Make file: Api.ts

/* eslint-disable *//* tslint:disable */import{HttpClient}from"./http-client";exportclassApi<SecurityDataType=unknown>{constructor(privatehttp: HttpClient<SecurityDataType>){}abc1=()=>this.http.request();abc2=()=>this.http.request();abc3=()=>this.http.request();}

and http-client.ts

/* eslint-disable *//* tslint:disable *//** Overrided Promise type. Needs for additional typings of `.catch` callback */typeTPromise<ResolveType,RejectType=any>=Omit<Promise<ResolveType>,"then"|"catch">&{then<TResult1=ResolveType,TResult2=never>(onfulfilled?: ((value: ResolveType)=>TResult1|PromiseLike<TResult1>)|undefined|null,onrejected?: ((reason: RejectType)=>TResult2|PromiseLike<TResult2>)|undefined|null,): TPromise<TResult1|TResult2,RejectType>;catch<TResult=never>(onrejected?: ((reason: RejectType)=>TResult|PromiseLike<TResult>)|undefined|null,): TPromise<ResolveType|TResult,RejectType>;};exportinterfaceHttpResponse<Dextendsunknown,Eextendsunknown=unknown>extendsResponse{data: D;error: E;}exportclassHttpClient<SecurityDataType=unknown>{publicrequest=<T=any,E=any>(): TPromise<HttpResponse<T,E>>=>{return''asany;};}

try to compile, you will see that "Issues checking in progress..." process take extra long time ~15 sec.
I dont know why, but if you Copy-Paste http-client.ts to Api.ts directly this check take <1 sec.

This files make this lib https://github.com/acacode/swagger-typescript-api with ~1000 this.http.request, and each this.http.request() took ~7 sec of checking. When I do this in intel i7 CPU, after ~30 min of compiling I got error about memory leak.

Video:https://user-images.githubusercontent.com/3511307/108701953-4a842480-7511-11eb-9924-7f3c0c60acd0.mp4

Environment

  • fork-ts-checker-webpack-plugin: 6.1.0
  • typescript: 3.9.9
  • eslint: 6.8.0
  • webpack: 4.46.0
  • os: Linux mint 18.3 KDE

Tested on latest typescript 4.2.2 - same result.

Same with tsc --watch --noEmit.

Video: https://user-images.githubusercontent.com/3511307/108986783-2eac8a00-769b-11eb-9f9e-27f914830c8d.mp4

Metadata

Metadata

Labels

Domain: Declaration EmitThe issue relates to the emission of d.ts filesDomain: PerformanceReports of unusually slow behaviorFix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions