Skip to content

Microsoft.Python.LanguageServer excessive resource usage #3724

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
KaiLicht opened this issue Dec 16, 2018 · 18 comments
Closed

Microsoft.Python.LanguageServer excessive resource usage #3724

KaiLicht opened this issue Dec 16, 2018 · 18 comments
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug

Comments

@KaiLicht
Copy link

Environment data

  • VS Code version: 1.30.0
  • Extension version (available under the Extensions sidebar): 2018.12.1
  • OS and version: macOS 10.14.1
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda, Python 3.7.0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: --

Expected behaviour

Microsoft.Python.LanguageServer is using a reasonable amount of ressources.

Actual behaviour

Microsoft.Python.LanguageServer is using 100%+ CPU Power which is of course draining my battery very fast.

Steps to reproduce:

  1. Install and git pull the library fast.ai
  2. Open the folder in VSCode

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

There's no output generated.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

[ms-python.python]: Command `python.datascience.exportoutputasnotebook` appears multiple times in the `commands` section.
TMSyntax.ts:46 Overwriting grammar scope name to file mapping for scope source.python.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/python/syntaxes/MagicPython.tmLanguage.json.
New grammar file: file:///Users/kai/.vscode/extensions/magicstack.magicpython-1.1.0/grammars/MagicPython.tmLanguage
e.register @ TMSyntax.ts:46
t._handleGrammarExtensionPointUser @ TMSyntax.ts:329
(anonymous) @ TMSyntax.ts:182
e._handle @ extensionsRegistry.ts:114
e.acceptUsers @ extensionsRegistry.ts:98
t._handleExtensionPoint @ extensionService.ts:490
t._onHasExtensions @ extensionService.ts:344
(anonymous) @ extensionService.ts:332
(anonymous) @ errors.ts:237
s.__generator.a.label @ errors.ts:237
s @ errors.ts:237
Promise resolved (async)
c @ errors.ts:237
s @ errors.ts:237
Promise resolved (async)
c @ errors.ts:237
o @ errors.ts:237
o @ errors.ts:237
t._scanAndHandleExtensions @ extensionService.ts:319
(anonymous) @ extensionService.ts:114
requestIdleCallback (async)
t.runWhenIdle @ async.ts:730
(anonymous) @ extensionService.ts:111
Promise resolved (async)
t._startDelayed @ extensionService.ts:109
t @ extensionService.ts:90
t.create @ types.ts:165
e._createInstance @ instantiationService.ts:104
e.createInstance @ instantiationService.ts:69
t.initServiceCollection @ shell.ts:466
t.renderContents @ shell.ts:171
t.open @ shell.ts:528
(anonymous) @ main.ts:147
Promise resolved (async)
(anonymous) @ main.ts:129
Promise resolved (async)
(anonymous) @ main.ts:125
Promise resolved (async)
(anonymous) @ main.ts:116
G @ main.ts:86
(anonymous) @ workbench.js:30
Promise resolved (async)
bootstrapWindow.load.removeDeveloperKeybindingsAfterLoad @ workbench.js:26
exports.load.e @ bootstrap-window.js:123
t._invokeFactory @ loader.js:970
t.complete @ loader.js:980
s._onModuleComplete @ loader.js:1580
s._onModuleComplete @ loader.js:1592
s._onModuleComplete @ loader.js:1592
s._onModuleComplete @ loader.js:1592
s._resolve @ loader.js:1542
s.defineModule @ loader.js:1206
s._onLoad @ loader.js:1283
(anonymous) @ loader.js:1453
e.triggerCallback @ loader.js:594
(anonymous) @ loader.js:588
t.load @ loader.js:745
e.load @ loader.js:588
i @ loader.js:1448
(anonymous) @ loader.js:1456
e.triggerErrorback @ loader.js:601
(anonymous) @ loader.js:588
(anonymous) @ loader.js:751
readFileAfterOpen @ fs.js:420
extensionHost.ts:329 [Extension Host] debugger listening on port 65352
extensionHost.ts:235 Extension Host
extensionHost.ts:236 Debugger listening on ws://127.0.0.1:65352/8dd1261d-3e1b-46fa-95cc-1cad6f5fd490
For help see https://nodejs.org/en/docs/inspector

log.ts:157  INFO no standard startup: not a new window
console.ts:134 [Extension Host] [UriError]: Scheme is missing: {scheme: "", authority: "", path: "", query: "", fragment: ""}
t.log @ console.ts:134
t._logExtensionHostMessage @ extensionHost.ts:453
(anonymous) @ extensionHost.ts:244
emitTwo @ events.js:126
emit @ events.js:214
emit @ internal/child_process.js:772
_combinedTickCallback @ internal/process/next_tick.js:141
_tickCallback @ internal/process/next_tick.js:180
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */python
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */*/python
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
console.ts:134 [Extension Host] Python Extension: Register Intepreter Watcher, Arg 1: {"$mid":1,"fsPath":"/Users/kai/Dropbox/SCRATCH/fastai","external":"file:///Users/kai/Dropbox/SCRATCH/fastai","path":"/Users/kai/Dropbox/SCRATCH/fastai","scheme":"file"}, Return Value: 
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */python
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */*/python
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Arg 1: {}, Return Value: 
console.ts:134 [Extension Host] Python Extension: Build the workspace interpreter watcher, Arg 1: {"$mid":1,"fsPath":"/Users/kai/Dropbox/SCRATCH/fastai","external":"file:///Users/kai/Dropbox/SCRATCH/fastai","path":"/Users/kai/Dropbox/SCRATCH/fastai","scheme":"file"}, Return Value: UNABLE TO DETERMINE VALUE
console.ts:134 [Extension Host] Python Extension: Register Intepreter Watcher, Arg 1: undefined, Return Value: 
console.ts:134 [Extension Host] Python Extension: Build the workspace interpreter watcher, Arg 1: undefined, Return Value: UNABLE TO DETERMINE VALUE
console.ts:134 [Extension Host] Python Extension: Get Platform Version, , Return Value: {"raw":"18.2.0","major":18,"minor":2,"patch":0,"prerelease":[],"build":[],"version":"18.2.0"}
console.ts:134 [Extension Host] Python Extension: Get language server folder name, , Return Value: "languageServer.0.1.72"
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, , Return Value: 
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, , Return Value: 
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, , Return Value: 
@d3r3kk d3r3kk added upstream-language server bug Issue identified by VS Code Team member as probable bug area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. labels Dec 17, 2018
@gramster
Copy link
Member

gramster commented Dec 17, 2018

Hi Kai

How much RAM does your Mac have? I've opened the fast.ai code and I find on my Mac the LS stabilizes at a little under 500MB RAM used. We're running the same version. I'm wondering what could be different.

Was it memory consumption too or just CPU that was excessive?

Is there anything unusual in your Python search path?

@KaiLicht
Copy link
Author

Hey!
My Mac has 16 GB RAM and the language server process takes ~570 MB RAM. For a small repo the language server consumes ~270 MB, so that's probably okay I guess. Only the CPU is at full throttle for the fast.ai repo.

What would you consider not normal? :-) The only thing I can think of is that the fastai package is installed with the --editable flag.

@gramster
Copy link
Member

I originally saw this bucketed with some other issues around excessive memory consumption but then realized you weren't complaining about that. We can repro your issue and are investigating. Thanks!

@phillies
Copy link

Same issue here on Windows 10
m3 CPU with 4 GB RAM, language server uses about 30-40% CPU constantly over more than 30 min now without touching the computer. RAM usage constant 480 MB
Happens not only with fastai but also other packages, but confirmed with fastai.
Switching to jedi solved the issue (obviously). Looks like the same issue as #3720

@thedadams

This comment has been minimized.

@gramster
Copy link
Member

@thedadams, it might be useful to attach a debugger to the Python process to see what it is and what it's doing. AFAIK unless you've started executing code in the debugger or Jupyter, when using the language server there shouldn't be any Python process.

@DonJayamanne

This comment has been minimized.

@thedadams

This comment has been minimized.

@DonJayamanne DonJayamanne self-assigned this Dec 19, 2018
@thedadams

This comment has been minimized.

@Artalus
Copy link

Artalus commented Dec 26, 2018

Reported it to main repository couple of days ago. Reposting here for ease of accessing the logs.

Python Language Server consumes tons of memory #65639 Issue Type: Bug

When I edit several python scripts (200-2000 lines each), over time the language server process starts to consume more and more RAM. It happens with both Microsoft.Python.LanguageServer and python jedi. This process is not limited and sometimes can eat up to my whole 16 GB + 8GB swap. If I kill the LS, its memory usages drops to almost none after the restart, but will eventually return to its previous state.
At the moment of writing this issue, htop shows it uses 7925M VIRT, 2095M RES and consumes 13% of memory.

VS Code version: Code 1.29.1 (bc24f98b5f70467bc689abf41cc5550ca637088e, 2018-11-15T19:07:43.495Z)
OS version: Linux x64 4.19.8-2-MANJARO

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz (8 x 805)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
video_decode: unavailable_software
video_encode: unavailable_software
webgl: enabled
webgl2: enabled
Load (avg) 2, 1, 1
Memory (System) 15.60GB (2.99GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (12)
Extension Author (truncated) Version
Bookmarks ale 10.0.0
gitlens eam 9.1.0
todo-tree Gru 0.0.110
quicktask lky 3.5.3
hg mrc 1.2.3
python ms- 2018.12.1
cpptools ms- 0.20.1
indent-rainbow ode 7.2.4
cmake twx 0.0.17
cmake-tools vec 1.1.3
expand-selection-to-scope vit 0.2.0
vscode-todo-highlight way 1.0.4

It actually led my system to invoke OOM Killer

$ journalctl
--8<--
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Microsoft.Python.LanguageServer Warning: 0 :
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Unhandled generic: typing.Generic
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Microsoft.Python.LanguageServer Warning: 0 :
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Unhandled generic: typing.Pattern
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Microsoft.Python.LanguageServer Warning: 0 :
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Unhandled generic: typing.IO
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Microsoft.Python.LanguageServer Warning: 0 :
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Unhandled generic: typing.IO
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Microsoft.Python.LanguageServer Warning: 0 :
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Unhandled generic: typing.IO
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Microsoft.Python.LanguageServer Warning: 0 :
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Unhandled generic: typing.Pattern
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Microsoft.Python.LanguageServer Warning: 0 :
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Unhandled generic: typing.Pattern
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Microsoft.Python.LanguageServer Warning: 0 :
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Unhandled generic: typing.Callable
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Microsoft.Python.LanguageServer Warning: 0 :
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Unhandled generic: typing.Generator
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Microsoft.Python.LanguageServer Warning: 0 :
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Unhandled generic: typing.IO
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Microsoft.Python.LanguageServer Warning: 0 :
Dec 24 15:49:07 dssl Microsoft.Python.LanguageServer[10547]: Unhandled generic: typing.Generic
Dec 24 15:49:52 dssl rtkit-daemon[995]: The canary thread is apparently starving. Taking action.
Dec 24 15:49:52 dssl rtkit-daemon[995]: Demoting known real-time threads.
Dec 24 15:49:52 dssl rtkit-daemon[995]: Successfully demoted thread 1083 of process 992 (/usr/bin/pulseaudio).
Dec 24 15:49:52 dssl rtkit-daemon[995]: Successfully demoted thread 1082 of process 992 (/usr/bin/pulseaudio).
Dec 24 15:49:52 dssl rtkit-daemon[995]: Successfully demoted thread 992 of process 992 (/usr/bin/pulseaudio).
Dec 24 15:49:52 dssl rtkit-daemon[995]: Demoted 3 threads.
Dec 24 15:50:39 dssl kernel: Xorg invoked oom-killer: gfp_mask=0x6200ca(GFP_HIGHUSER_MOVABLE), nodemask=(null), order=0, oom_score_>
Dec 24 15:50:39 dssl kernel: Xorg cpuset=/ mems_allowed=0
Dec 24 15:50:39 dssl kernel: CPU: 7 PID: 658 Comm: Xorg Tainted: P         C OE     4.19.8-2-MANJARO #1
Dec 24 15:50:39 dssl kernel: Hardware name: System manufacturer System Product Name/Z170-P, BIOS 2003 09/19/2016
Dec 24 15:50:39 dssl kernel: Call Trace:
Dec 24 15:50:39 dssl kernel:  dump_stack+0x5c/0x80
Dec 24 15:50:39 dssl kernel:  dump_header+0x6b/0x2ad
Dec 24 15:50:39 dssl kernel:  ? rcu_oom_notify+0x4f/0x100
Dec 24 15:50:39 dssl kernel:  ? preempt_count_add+0x79/0xb0
Dec 24 15:50:39 dssl kernel:  ? _raw_spin_trylock+0x13/0x50
Dec 24 15:50:39 dssl kernel:  oom_kill_process.cold.7+0xb/0x1e4
Dec 24 15:50:39 dssl kernel:  out_of_memory+0x1a3/0x450
Dec 24 15:50:39 dssl kernel:  __alloc_pages_nodemask+0xc81/0xfb0
Dec 24 15:50:39 dssl kernel:  filemap_fault+0x3f9/0x630
Dec 24 15:50:39 dssl kernel:  ext4_filemap_fault+0x2c/0x40 [ext4]
Dec 24 15:50:39 dssl kernel:  __do_fault+0x20/0xe0
Dec 24 15:50:39 dssl kernel:  __handle_mm_fault+0xde8/0x1610
Dec 24 15:50:39 dssl kernel:  handle_mm_fault+0x10a/0x250
Dec 24 15:50:39 dssl kernel:  __do_page_fault+0x214/0x570
Dec 24 15:50:39 dssl kernel:  do_page_fault+0x32/0x130
Dec 24 15:50:39 dssl kernel:  ? page_fault+0x8/0x30
Dec 24 15:50:39 dssl kernel:  page_fault+0x1e/0x30
Dec 24 15:50:39 dssl kernel: RIP: 0033:0x7f59b7192e00
Dec 24 15:50:39 dssl kernel: Code: Bad RIP value.
Dec 24 15:50:39 dssl kernel: RSP: 002b:00007ffeaa5e7a00 EFLAGS: 00013206
Dec 24 15:50:39 dssl kernel: RAX: 0000000000000005 RBX: 000055ef3c070c90 RCX: 00000000ffffff9d
Dec 24 15:50:39 dssl kernel: RDX: 00007ffeaa5e7a00 RSI: 00007ffeaa5e7b30 RDI: 000000000000000e
Dec 24 15:50:39 dssl kernel: RBP: 00000000000004d5 R08: 00007ffeaa5e80e8 R09: 0000000000000000
Dec 24 15:50:39 dssl kernel: R10: 0000000000000000 R11: 000d2780f16ea146 R12: 000055ef3c358430
Dec 24 15:50:39 dssl kernel: R13: 00000000000004fd R14: 00007ffeaa5e80f0 R15: 000055ef3ab24fb0
Dec 24 15:50:39 dssl kernel: Mem-Info:
Dec 24 15:50:39 dssl kernel: active_anon:3582399 inactive_anon:326125 isolated_anon:0
                              active_file:134 inactive_file:13 isolated_file:0
                              unevictable:62 dirty:0 writeback:0 unstable:0
                              slab_reclaimable:24155 slab_unreclaimable:30201
                              mapped:34388 shmem:14833 pagetables:27710 bounce:0
                              free:33560 free_pcp:904 free_cma:0
Dec 24 15:50:39 dssl kernel: Node 0 active_anon:14329596kB inactive_anon:1304500kB active_file:536kB inactive_file:52kB unevictable>
Dec 24 15:50:39 dssl kernel: Node 0 DMA free:15892kB min:64kB low:80kB high:96kB active_anon:0kB inactive_anon:0kB active_file:0kB >
Dec 24 15:50:39 dssl kernel: lowmem_reserve[]: 0 3063 15945 15945 15945
Dec 24 15:50:39 dssl kernel: Node 0 DMA32 free:64432kB min:12972kB low:16212kB high:19452kB active_anon:2782796kB inactive_anon:279>
Dec 24 15:50:39 dssl kernel: lowmem_reserve[]: 0 0 12882 12882 12882
Dec 24 15:50:39 dssl kernel: Node 0 Normal free:53916kB min:54544kB low:68180kB high:81816kB active_anon:11546968kB inactive_anon:1>
Dec 24 15:50:39 dssl kernel: lowmem_reserve[]: 0 0 0 0 0
Dec 24 15:50:39 dssl kernel: Node 0 DMA: 1*4kB (U) 0*8kB 1*16kB (U) 0*32kB 2*64kB (U) 1*128kB (U) 1*256kB (U) 0*512kB 1*1024kB (U) >
Dec 24 15:50:39 dssl kernel: Node 0 DMA32: 129*4kB (UME) 119*8kB (UME) 311*16kB (UME) 276*32kB (UME) 156*64kB (UME) 73*128kB (UME) >
Dec 24 15:50:39 dssl kernel: Node 0 Normal: 1109*4kB (UME) 531*8kB (UME) 644*16kB (UME) 431*32kB (UME) 257*64kB (UME) 41*128kB (UME>
Dec 24 15:50:39 dssl kernel: Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
Dec 24 15:50:39 dssl kernel: Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
Dec 24 15:50:39 dssl kernel: 138792 total pagecache pages
Dec 24 15:50:39 dssl kernel: 123527 pages in swap cache
Dec 24 15:50:39 dssl kernel: Swap cache stats: add 4868983, delete 4744950, find 971737/1689520
Dec 24 15:50:39 dssl kernel: Free swap  = 0kB
Dec 24 15:50:39 dssl kernel: Total swap = 8388604kB
Dec 24 15:50:39 dssl kernel: 4177984 pages RAM
Dec 24 15:50:39 dssl kernel: 0 pages HighMem/MovableOnly
Dec 24 15:50:39 dssl kernel: 88119 pages reserved
Dec 24 15:50:39 dssl kernel: 0 pages hwpoisoned
Dec 24 15:50:39 dssl kernel: Tasks state (memory values in pages):
Dec 24 15:50:39 dssl kernel: [  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name
Dec 24 15:50:39 dssl kernel: [    324]     0   324   133347       16  1056768      243             0 systemd-journal
--8<--
Dec 24 15:50:39 dssl kernel: [   2688]  1000  2688   200779      135   831488     6855           300 code
Dec 24 15:50:39 dssl kernel: [   2747]  1000  2747  1387043      448  1929216   161442           300 Microsoft.Pytho
Dec 24 15:50:39 dssl kernel: [   2878]  1000  2878   335869        0   356352    11854           300 Microsoft.VSCod
Dec 24 15:50:39 dssl kernel: [   4132]  1000  4132   138557     1756   405504     7604             0 xfce4-terminal
--8<--
Dec 24 15:50:39 dssl kernel: [   9796]  1000  9796     6056        0    77824      199             0 ssh
Dec 24 15:50:39 dssl kernel: [  10547]  1000 10547  2540541   626735  8581120   253758           300 Microsoft.Pytho
Dec 24 15:50:39 dssl kernel: [  19029]  1000 19029     2631        1    69632      441             0 bash
Dec 24 15:50:39 dssl kernel: [  19144]  1000 19144   331531    33251  3801088    19019           300 code
Dec 24 15:50:39 dssl kernel: [  19179]  1000 19179   208335      132   700416     5976           300 code
Dec 24 15:50:39 dssl kernel: [  19180]  1000 19180   307777     1158  2891776    30435           300 code
Dec 24 15:50:39 dssl kernel: [  19276]  1000 19276   409634        0   544768    36770           300 Microsoft.VSCod
Dec 24 15:50:39 dssl kernel: [  19303]  1000 19303   238812        0   647168    62114           300 Microsoft.VSCod
Dec 24 15:50:39 dssl kernel: [  19394]  1000 19394     2630        2    65536      443           300 bash
Dec 24 15:50:39 dssl kernel: [  20841]  1000 20841   199627      171   655360     5476           300 code
Dec 24 15:50:39 dssl kernel: [  30987]  1000 30987   226141      111  1556480    16272           300 code
Dec 24 15:50:39 dssl kernel: [   3548]  1000  3548     2631        1    69632      448             0 bash
Dec 24 15:50:39 dssl kernel: [  13295]  1000 13295    72396      317   204800     1072             0 python2
Dec 24 15:50:39 dssl kernel: [  17575]  1000 17575     8155     2207   110592     2203             0 make
Dec 24 15:50:39 dssl kernel: [  18726]  1000 18726     4064        0    73728       72             0 sh
Dec 24 15:50:39 dssl kernel: [  18727]  1000 18727     3266        0    65536       45             0 gcc
Dec 24 15:50:39 dssl kernel: [  18728]  1000 18728   403447   302431  3244032    81931             0 cc1plus
Dec 24 15:50:39 dssl kernel: [  18795]  1000 18795     4064       52    81920        0             0 sh
Dec 24 15:50:39 dssl kernel: [  18796]  1000 18796     3266       32    65536        0             0 gcc
Dec 24 15:50:39 dssl kernel: [  18797]  1000 18797   377070   358096  3022848        0             0 cc1plus
Dec 24 15:50:39 dssl kernel: [  18799]  1000 18799     4064       52    81920        0             0 sh
Dec 24 15:50:39 dssl kernel: [  18800]  1000 18800     3266       32    69632        0             0 gcc
Dec 24 15:50:39 dssl kernel: [  18801]  1000 18801   389913   370681  3117056        0             0 cc1plus
Dec 24 15:50:39 dssl kernel: [  18895]  1000 18895     4064       53    73728        0             0 sh
Dec 24 15:50:39 dssl kernel: [  18897]  1000 18897     3266       32    65536        0             0 gcc
Dec 24 15:50:39 dssl kernel: [  18899]  1000 18899   310480   291822  2482176        0             0 cc1plus
Dec 24 15:50:39 dssl kernel: [  19113]  1000 19113     4064       53    77824        0             0 sh
Dec 24 15:50:39 dssl kernel: [  19114]  1000 19114     3266       32    65536        0             0 gcc
Dec 24 15:50:39 dssl kernel: [  19115]  1000 19115   192385   168722  1490944        0             0 cc1plus
Dec 24 15:50:39 dssl kernel: [  19241]  1000 19241     4099      100    86016        0             0 sh
Dec 24 15:50:39 dssl kernel: [  19244]  1000 19244   223440   157698  1499136        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19249]  1000 19249     4098       91    77824        0             0 sh
Dec 24 15:50:39 dssl kernel: [  19256]  1000 19256   223311   150651  1445888        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19273]  1000 19273     4098       54    69632        0             0 sh
Dec 24 15:50:39 dssl kernel: [  19274]  1000 19274   172175   111833  1126400        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19338]  1000 19338    39743    19102   360448        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19339]  1000 19339    41552    21388   372736        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19340]  1000 19340    43356    23207   401408        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19341]  1000 19341    40518    20197   360448        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19342]  1000 19342    49411    28319   450560        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19343]  1000 19343    57472    37303   495616        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19344]  1000 19344    37202    17034   327680        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19345]  1000 19345    67838    47679   577536        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19355]  1000 19355    36389    16151   331776        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19356]  1000 19356    39175    18969   372736        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19357]  1000 19357    39967    19828   393216        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19358]  1000 19358    36909    16773   364544        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19359]  1000 19359    30453    10315   299008        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19360]  1000 19360    35647    14974   323584        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19361]  1000 19361    34563    13939   319488        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19362]  1000 19362    33742    13461   307200        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19369]  1000 19369    38298    18104   339968        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19370]  1000 19370    33497    13314   303104        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19371]  1000 19371    43128    22907   376832        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19372]  1000 19372    37753    17567   323584        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19373]  1000 19373    32271    12079   286720        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19374]  1000 19374    39379    18933   352256        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19375]  1000 19375    31758    11578   290816        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19376]  1000 19376    31798    11535   278528        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19384]  1000 19384     4064       52    69632        0             0 sh
Dec 24 15:50:39 dssl kernel: [  19385]  1000 19385     3266       33    65536        0             0 gcc
Dec 24 15:50:39 dssl kernel: [  19387]  1000 19387     3153       28    69632        0             0 collect2
Dec 24 15:50:39 dssl kernel: [  19388]  1000 19388     4099      102    77824        0             0 sh
Dec 24 15:50:39 dssl kernel: [  19389]  1000 19389   148816    87089   925696        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19390]  1000 19390    27613    23431   253952        0             0 ld
Dec 24 15:50:39 dssl kernel: [  19404]  1000 19404     4064       53    77824        0             0 sh
Dec 24 15:50:39 dssl kernel: [  19405]  1000 19405    29228     9039   262144        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19406]  1000 19406    28215     8077   258048        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19407]  1000 19407    34457    14284   319488        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19408]  1000 19408    36432    15737   331776        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19409]  1000 19409    33024    12617   303104        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19410]  1000 19410    33836    13589   319488        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19411]  1000 19411    26257     6085   233472        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19412]  1000 19412    32514    12340   290816        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19414]  1000 19414     3266       33    61440        0             0 gcc
Dec 24 15:50:39 dssl kernel: [  19417]  1000 19417     3153       27    73728        0             0 collect2
Dec 24 15:50:39 dssl kernel: [  19418]  1000 19418     4064       51    77824        0             0 sh
Dec 24 15:50:39 dssl kernel: [  19419]  1000 19419    14884     1208   163840        0             0 python2
Dec 24 15:50:39 dssl kernel: [  19420]  1000 19420    27514    23380   258048        0             0 ld
Dec 24 15:50:39 dssl kernel: [  19421]  1000 19421    91415      287   557056        0             0 test-t1c-qt4gui
Dec 24 15:50:39 dssl kernel: Out of memory: Kill process 10547 (Microsoft.Pytho) score 442 or sacrifice child
Dec 24 15:50:39 dssl kernel: Killed process 10547 (Microsoft.Pytho) total-vm:10162164kB, anon-rss:2506940kB, file-rss:0kB, shmem-rs>
Dec 24 15:50:39 dssl kernel: oom_reaper: reaped process 10547 (Microsoft.Pytho), now anon-rss:4kB, file-rss:0kB, shmem-rss:0kB
Dec 24 15:50:49 dssl Microsoft.Python.LanguageServer[19453]: Microsoft.Python.LanguageServer Warning: 0 :
Dec 24 15:50:49 dssl Microsoft.Python.LanguageServer[19453]: Unhandled generic: typing.IO
Dec 24 15:50:49 dssl Microsoft.Python.LanguageServer[19453]: Microsoft.Python.LanguageServer Warning: 0 :
Dec 24 15:50:49 dssl Microsoft.Python.LanguageServer[19453]: Unhandled generic: typing.IO
--8<--

@Moshikol
Copy link

any solutions for that one?

@Ronkiro
Copy link

Ronkiro commented Feb 22, 2019

Is there any chances that this is caused due to security softwares? (Like antivirus, enterprise Windows, etc)

@Ronkiro
Copy link

Ronkiro commented Feb 26, 2019

As an addition.

This issue sounds as the same issue i have here. (Detailed at #4416 )
The modules keep reloading as said there.

@keyunjie96
Copy link

Is there any chances that this is caused due to security software? (Like antivirus, enterprise Windows, etc)

Not only on Windows, but Mac users also suffer from the Python Language Server.

@sleighsoft
Copy link

sleighsoft commented Apr 30, 2019

Maybe it is related:

When I open up VSCode in one of my projects cpu usage goes to 80%+ while it continually shows "Discovering Tests" in the lower bar.
I have configured 'pytest'.
Python version 3.7.3

Edit:
It seems that pytest found a "debug" file without a if __name__ == "__main__": and ran it (my bad) during discovery. That caused the high CPU usage and pytest did not finish running it but it was not apparent that pytest was currently running that file in the first place. As no error message is printed to Python Test log when canceling Test Discovery I did not get prompted with an error message saying something like "execution stopped in file xxxx.py" which would have pointed me to the culprit. I only discovered this while manually running pytest from the console.
I suggest that the error message that arises from stopping pytest prematurely should be logged somewhere within vscode.

Version: 1.33.1 (user setup)
Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8
Date: 2019-04-11T08:27:14.102Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17763

@kazbeel
Copy link

kazbeel commented Jun 28, 2019

I have created a very simple Python project just to make some tests. And after some time, I can confirm that I only have memory leaks when pointing to a Virtual Environment. At the right moment I change the "python.pythonPath" to the system's python executable, the memory leak disappears.

I have only tested on Windows.

@luabud
Copy link
Member

luabud commented Sep 11, 2019

A lot of performance issues were fixed in the last 2 months with the Language Server. If you still have specific perf problems with the Language Server, please file an issue on the other repo. If you have perf issues that are not related to the language server, please file another issue on this repo.

@luabud luabud closed this as completed Sep 11, 2019
@ghost ghost removed the needs upstream fix label Sep 11, 2019
@KaiLicht
Copy link
Author

I can definitely confirm, that my original issue is fixed now.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests