Skip to content

Commit 149c066

Browse files
authored
Add ability to disable the check on memory usage of language server (Jedi) process (microsoft#1156)
* 🐛 ability to turn off check and add threshold check * 📝 news entry * Fixes microsoft#1036
1 parent 60fec3a commit 149c066

File tree

13 files changed

+199
-170
lines changed

13 files changed

+199
-170
lines changed

news/2 Fixes/1036.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Add ability to disable the check on memory usage of language server (Jedi) process.
2+
To turn off this check, add the following setting into your user or workspace settings (`settings.json`) file:
3+
```json
4+
"python.jediMemoryLimit": -1
5+
```

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,8 +1007,8 @@
10071007
},
10081008
"python.jediMemoryLimit": {
10091009
"type": "number",
1010-
"default": "0",
1011-
"description": "Memory limit for the Jedi completion engine in megabytes. Zero (default) means 1024 MB",
1010+
"default": 0,
1011+
"description": "Memory limit for the Jedi completion engine in megabytes. Zero (default) means 1024 MB. -1 means unlimited (disable memory limit check)",
10121012
"scope": "resource"
10131013
},
10141014
"python.sortImports.path": {

src/client/telemetry/stopWatch.ts renamed to src/client/common/stopWatch.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ export class StopWatch {
88
public get elapsedTime() {
99
return Date.now() - this.started;
1010
}
11+
public reset(){
12+
this.started = Date.now();
13+
}
1114
}

src/client/debugger/Common/telemetry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// tslint:disable:no-function-expression no-any no-invalid-this no-use-before-declare
55

66
import { DebugSession, StoppedEvent } from 'vscode-debugadapter';
7+
import { StopWatch } from '../../common/stopWatch';
78
import { DEBUGGER_PERFORMANCE } from '../../telemetry/constants';
8-
import { StopWatch } from '../../telemetry/stopWatch';
99
import { DebuggerPerformanceTelemetry } from '../../telemetry/types';
1010
import { TelemetryEvent } from './Contracts';
1111

src/client/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { registerTypes as installerRegisterTypes } from './common/installer/serv
2020
import { registerTypes as platformRegisterTypes } from './common/platform/serviceRegistry';
2121
import { registerTypes as processRegisterTypes } from './common/process/serviceRegistry';
2222
import { registerTypes as commonRegisterTypes } from './common/serviceRegistry';
23+
import { StopWatch } from './common/stopWatch';
2324
import { GLOBAL_MEMENTO, IDisposableRegistry, ILogger, IMemento, IOutputChannel, IPersistentStateFactory, WORKSPACE_MEMENTO } from './common/types';
2425
import { registerTypes as variableRegisterTypes } from './common/variables/serviceRegistry';
2526
import { BaseConfigurationProvider } from './debugger/configProviders/baseProvider';
@@ -53,7 +54,6 @@ import { activateUpdateSparkLibraryProvider } from './providers/updateSparkLibra
5354
import * as sortImports from './sortImports';
5455
import { sendTelemetryEvent } from './telemetry';
5556
import { EDITOR_LOAD } from './telemetry/constants';
56-
import { StopWatch } from './telemetry/stopWatch';
5757
import { registerTypes as commonRegisterTerminalTypes } from './terminals/serviceRegistry';
5858
import { ICodeExecutionManager } from './terminals/types';
5959
import { BlockFormatProviders } from './typeFormatters/blockFormatProvider';

src/client/formatters/autoPep8Formatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as vscode from 'vscode';
22
import { Product } from '../common/installer/productInstaller';
3+
import { StopWatch } from '../common/stopWatch';
34
import { IConfigurationService } from '../common/types';
45
import { IServiceContainer } from '../ioc/types';
56
import { sendTelemetryWhenDone } from '../telemetry';
67
import { FORMAT } from '../telemetry/constants';
7-
import { StopWatch } from '../telemetry/stopWatch';
88
import { BaseFormatter } from './baseFormatter';
99

1010
export class AutoPep8Formatter extends BaseFormatter {

src/client/formatters/yapfFormatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as vscode from 'vscode';
2+
import { StopWatch } from '../common/stopWatch';
23
import { IConfigurationService, Product } from '../common/types';
34
import { IServiceContainer } from '../ioc/types';
45
import { sendTelemetryWhenDone } from '../telemetry';
56
import { FORMAT } from '../telemetry/constants';
6-
import { StopWatch } from '../telemetry/stopWatch';
77
import { BaseFormatter } from './baseFormatter';
88

99
export class YapfFormatter extends BaseFormatter {

src/client/interpreter/configuration/pythonPathUpdaterService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { inject, injectable } from 'inversify';
22
import * as path from 'path';
33
import { ConfigurationTarget, Uri, window } from 'vscode';
4+
import { StopWatch } from '../../common/stopWatch';
45
import { IServiceContainer } from '../../ioc/types';
56
import { sendTelemetryEvent } from '../../telemetry';
67
import { PYTHON_INTERPRETER } from '../../telemetry/constants';
7-
import { StopWatch } from '../../telemetry/stopWatch';
88
import { PythonInterpreterTelemetry } from '../../telemetry/types';
99
import { IInterpreterVersionService } from '../contracts';
1010
import { IPythonPathUpdaterServiceFactory, IPythonPathUpdaterServiceManager } from './types';

0 commit comments

Comments
 (0)