vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

When open a cpp file with 300000 lines,cpptools-srv will use huge memories, and make the linux system break

Open YF123E opened this issue 3 years ago • 3 comments

Issue Type: Bug

1.open a cpp file with 300000 lines 2. check the memory usage in linux system, susytem will crash in few minutes

Extension version: 1.11.0 VS Code version: Code 1.68.1 (30d9c6cd9483b2cc586687151bcbcd635f373630, 2022-06-14T12:48:58.283Z) OS version: Windows_NT x64 10.0.19043 Restricted Mode: No Remote OS version: Linux x64 5.3.0-51-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i5-10505 CPU @ 3.20GHz (12 x 3192)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.75GB (8.07GB free)
Process Argv --crash-reporter-id 24a3dd1a-a7aa-4c0f-a96b-309f359c3e89
Screen Reader no
VM 0%
Item Value
Remote SSH: 10.50.30.254
OS Linux x64 5.3.0-51-generic
CPUs Intel(R) Core(TM) i5-10505 CPU @ 3.20GHz (12 x 4355)
Memory (System) 15.39GB (3.37GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
vscscmwlcmt:30465135
cppdebug:30492333
vsclangdf:30486550
841h4636:30513380

YF123E avatar Jun 21 '22 06:06 YF123E

Why do you have a 300000 line file? That may be bigger than what we're able to handle.

How much memory does your machine have? Have you tried adjusting the C_Cpp.intelliSenseMemoryLimit setting?

What is "susystem"? The behavior of your machine when a process requests too much memory is the responsibility of the OS to handle well. Some OS's deal with it better than others, i.e. freezing/crashing versus not. Linux OS's tend to not handle low memory conditions well compared to Windows/Mac.

sean-mcmanus avatar Jun 21 '22 19:06 sean-mcmanus

First,thank for your reply. The big code file was auto generated, it's really a bad solution, but it sure be existed. My machine has more than 10GB memory,and I also tried to adjust the settings like C_Cpp.intelliSenseMemoryLimit, C_Cpp.intelliSense.maxMemory,C_Cpp.maxMemory, but cpptools-srv still use huge memory and make my linux OS break.

YF123E avatar Jun 22 '22 02:06 YF123E

Okay, the 1st thing we need to do is to get a repro and identify which system/feature in cpptools is using the memory, then we could potentially disable the feature if memory usage becomes too large. My guess would be the document outline feature, since that has had memory issues in the past.

The largest generated file we've tested with so far is sqlite3, which is around 200k lines.

sean-mcmanus avatar Jun 22 '22 17:06 sean-mcmanus