Skip to content

Extension process using too much memory in the filename cache #4714

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
bobbrow opened this issue Dec 7, 2019 · 25 comments
Closed

Extension process using too much memory in the filename cache #4714

bobbrow opened this issue Dec 7, 2019 · 25 comments
Labels
fixed Check the Milestone for the release in which the fix is or will be available. Language Service performance
Milestone

Comments

@bobbrow
Copy link
Member

bobbrow commented Dec 7, 2019

@sean-mcmanus Yes, it's happens during code write, I get (cpptools:.... )"Connection to server got closed. Server will not be restarted", but I still get this message. And in task explorer I see how "Microsoft.VSCode.CPP.IntelliSense.Msvc.exe" allocate memory and then it up to 4G is closed.
Reproducing steps is not clear. But rollback to 0.26.1 helps until restart the VCCode (I can mistake, need more investigation).
When I got clear steps, I will inform you. I'll try to get the "Microsoft.VSCode.CPP.IntelliSense.Msvc.exe" dump during crush.

My configuration is still the same:
{
"compileCommands": ".../compile_commands.json",
"compilerPath": ".../14.16.27023/bin/Hostx64/x64/cl.exe",
"intelliSenseMode": "msvc-x64",
"cppStandard": "c++17",
"cStandard": "c11",
"defines": [.....],
"includePath": [....].
"browse": {
"limitSymbolsToIncludedHeaders": true
}
}

Originally posted by @Gargony in #3270 (comment)

@bobbrow bobbrow changed the title Connection to server got closed. Server will not be restarted", but I still get this message. And in task explorer I see how "Microsoft.VSCode.CPP.IntelliSense.Msvc.exe" allocate memory and then it up to 4G is closed. Connection to server got closed. Server will not be restarted" Dec 7, 2019
@bobbrow
Copy link
Member Author

bobbrow commented Dec 7, 2019

@Gargony replied:

@sean-mcmanus may be this help

WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
(1460.88ec): C++ EH exception - code e06d7363 (first chance)
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
WER/CrashAPI:2655: ERROR Invalid args, too  big block
(1460.7e10): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=062cc044 ebx=0340fb88 ecx=0340fb08 edx=00000000 esi=7fffffff edi=0340fae0
eip=0046d46d esp=0340f90c ebp=0340f978 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246
Microsoft_VSCode_CPP_IntelliSense_Msvc!edge::scoped_query_manager::check_and_compile+0x31f:
0046d46d 0fb64008        movzx   eax,byte ptr [eax+8]       ds:002b:062cc04c=??

@bobbrow
Copy link
Member Author

bobbrow commented Dec 7, 2019

@sean-mcmanus replied:

@Gargony We fixed a high hitting crash with 0.26.0.1 involving "check_and_compile"...if you have 0.26.1 or later, then you could be hitting a less commonly hitting crash with that method. We might need an isolated/sample repro to fix that.

Is the memory usage related to the crash or are they separate issues? What causes the memory to get to 4 GB? Just opening a file? Or does it accumulate as the cursor is moved around the file? Or only after edits?

@Gargony
Copy link

Gargony commented Dec 9, 2019

@bobbrow I got crash with memory up to 4 GB on Microsoft.VSCode.CPP.Extension.exe (0.26.2.2)
After that the Microsoft.VSCode.CPP.Extension.exe restarted and all repeat again.

Microsoft_VSCode_CPP_Extension!__scrt_throw_std_bad_alloc+0x1f
0x382f000
Microsoft_VSCode_CPP_Extension!std::_Allocate_manually_vector_aligned<std::_Default_allocate_traits>+0x17
Microsoft_VSCode_CPP_Extension!std::_Allocate<8,std::_Default_allocate_traits,0>+0x13
Microsoft_VSCode_CPP_Extension!std::allocator<std::_List_unchecked_const_iterator<std::_List_val<std::_List_simple_types<filename_entry *> >,std::_Iterator_base0> >::allocate+0x1c
Microsoft_VSCode_CPP_Extension!std::vector<std::_List_unchecked_const_iterator<std::_List_val<std::_List_simple_types<filename_entry *> >,std::_Iterator_base0>,std::allocator<std::_List_unchecked_const_iterator<std::_List_val<std::_List_simple_types<filename_entry *> >,std::_Iterator_base0> > >::_Reallocate_exactly+0x19
Microsoft_VSCode_CPP_Extension!std::_Hash<std::_Uset_traits<filename_entry *,std::_Uhash_compare<filename_entry *,std::hash<filename_entry *>,std::equal_to<filename_entry *> >,std::allocator<filename_entry *>,0> >::_Init+0x1d
Microsoft_VSCode_CPP_Extension!std::_Hash<std::_Uset_traits<filename_entry *,std::_Uhash_compare<filename_entry *,std::hash<filename_entry *>,std::equal_to<filename_entry *> >,std::allocator<filename_entry *>,0> >::_Check_size+0x39
Microsoft_VSCode_CPP_Extension!std::_Hash<std::_Uset_traits<filename_entry *,std::_Uhash_compare<filename_entry *,std::hash<filename_entry *>,std::equal_to<filename_entry *> >,std::allocator<filename_entry *>,0> >::_Insert<filename_entry *,std::_Not_a_node_tag>+0xa7
Microsoft_VSCode_CPP_Extension!browse_engine::populate_filename_cache+0x7a8
Microsoft_VSCode_CPP_Extension!browse_engine::query_translation_unit_source+0x141
Microsoft_VSCode_CPP_Extension!create_sync_work+0x13f
Microsoft_VSCode_CPP_Extension!create_async_work+0x9d
Microsoft_VSCode_CPP_Extension!<lambda_22a3a4f55eafaf5e1ed922229c820ce6>::operator()+0xf9
Microsoft_VSCode_CPP_Extension!std::_Func_impl_no_alloc<<lambda_66f0a2a1d5b8c10b4ef2a449fd6e2e9e>,void>::_Do_call+0xf
Microsoft_VSCode_CPP_Extension!msvc::thread_pool::do_work+0x149
Microsoft_VSCode_CPP_Extension!std::_LaunchPad<std::unique_ptr<std::tuple<<lambda_a3c66ca3d4c2719be92bdb8d8b1f4c0e> >,std::default_delete<std::tuple<<lambda_a3c66ca3d4c2719be92bdb8d8b1f4c0e> > > > >::_Go+0x26
Microsoft_VSCode_CPP_Extension!std::_Pad::_Call_func+0xa
Microsoft_VSCode_CPP_Extension!thread_start<unsigned int (__stdcall*)(void *)>+0x58
KERNEL32!BaseThreadInitThunk+0x24
ntdll!__RtlUserThreadStart+0x2f
ntdll!_RtlUserThreadStart+0x1b

@Colengms
Copy link
Contributor

Colengms commented Dec 9, 2019

Hi @Gargony . Do you have a huge number of files in your project? It looks like you're running out of memory (on a 32-bit system?) while building a table of header/source relationships from data in the tag parser database.

@Gargony
Copy link

Gargony commented Dec 10, 2019

Hi @Colengms . I'm not sure about border huge and less files ))) We have a mobile application about ~1K+ cpp files. boost, stl, templates like this https://github.com/DevUtilsNet/linqcpp/blob/master/include/linqcpp/linqcpp.h and etc. Nothing special, usual project ))) Please tell me what information I can provide to you? I can provide compile_commands.json (3Mb+), build.ninja (4Mb+) or somphing like this.
"ipch" folder (3Gb+)
FYI: command "C/C++: Reset IntelliSense Database" helps in short terms

@sean-mcmanus
Copy link
Contributor

Does the bug re-appear after doing the Reset IntelliSense Database, i.e. does it seem like the database was in a bad state due to a previously fixed issue?

@Gargony
Copy link

Gargony commented Dec 10, 2019

@sean-mcmanus Yes, the bug re-appear after I doing the Reset IntelliSense Database.
Ok, I'll remove folder "ipch" and let you know it fixed or not.

@Gargony
Copy link

Gargony commented Dec 10, 2019

@sean-mcmanus after clear "ipch" the process Microsoft.VSCode.CPP.Extension.exe works and after about ~3h is began crush ("ipch" ~830Mb)

@Colengms
Copy link
Contributor

Hi @Gargony .

The specific allocation that failed is an association between a header and a file that includes it. This information is used to select an appropriate source file when creating an IntelliSense Translation Unit, as a header file is opened. It's possible that a very large number of #include statements (not necessarily files) could lead to excessive memory usage. Running out of memory here is surprising. It sounds like we may need to rethink how this is implemented.

Do you consistently see the same stack (within populate_filename_cache) ? If you see any other stacks associated with the issue, they may provide some clues.

In the meanwhile, I will see what we can do to reduce the overhead involved in includer/includee associations.

@Gargony
Copy link

Gargony commented Dec 12, 2019

Hi @Colengms the stack is the same
please look at dump, maybe it help.
Microsoft.VSCode.CPP.Extension.exe.dmp.zip

@sean-mcmanus
Copy link
Contributor

@Gargony I just see a "bad_alloc" with no other call stack. Are you able to attach a debugger and set "symbolSearchPath" to "https://msdl.microsoft.com/download/symbols" to get a better call stack?

We'll try to release 0.26.3-insiders Monday which may fix the issue via using less memory.

@sean-mcmanus
Copy link
Contributor

Ignore my last post -- we got the call stack from the dmp.

To double check, after you do a Reset IntelliSense Database, how long does it take to finish parsing? 3 hours? After the database is built, how long does it take for the crash to occur? How fast do you see the memory usage increase? Over a matter of seconds or minutes or hours?

We'll try to add more logging to our 0.26.3-insiders build (tentatively for Monday).

@Gargony
Copy link

Gargony commented Dec 16, 2019

Hi @sean-mcmanus , here https://1drv.ms/u/s!Ai8Z7kEn6DQTmKwCzpBTWFPzZ9cBig?e=Skb8qC you can see how memory is grows. After Reset IntelliSense Database the vscode-cpptools take a few seconds and all works fine until next apisode.

Microsoft.VSCode.CPP.Extension.exe (0.26.2.2)

@sean-mcmanus
Copy link
Contributor

https://github.com/microsoft/vscode-cpptools/releases/tag/0.26.3-insiders has a fixed that reduced the memory usage -- is anything better with that? We added more logging with the hidden value of "7", but for some strange reason I'm not seeing that logging (might need to debug it tomorrow).

But 0.26.3-insiders has a known IntelliSense crash regression (#4752) if you happen to hit that.

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Dec 18, 2019

I see the "Files in filename cache" logging now -- the cache has to be regenerated. Let us know if you are able to get any "filename cache" logging info.

UPDATE: FYI, we've unpublished 0.26.3-insiders until we can get the crash regression fixed.

@Gargony
Copy link

Gargony commented Dec 18, 2019

@sean-mcmanus Sorry but I don't see any helpful info in C/C++ output. This output taken when the Microsoft.VSCode.CPP.Extension.exe (0.26.3.0) in bug state (out of memory and restarting)

initialized
workspace/didChangeConfiguration
Подсистема IntelliSense: Default.
Автозавершение включено.
Расширенная раскраска включена.
Волнистые линии для ошибок включены.
Исключение файла: **/.git
Исключение файла: **/.svn
Исключение файла: **/.hg
Исключение файла: **/CVS
Исключение файла: **/.DS_Store
Исключение файла: **/.vscode
Исключение поиска: **/node_modules
Исключение поиска: **/bower_components
Исключение поиска: **/.vscode
Попытка получить значения по умолчанию из обнаруженного на компьютере компилятора: "".
Подходящий компилятор не найден. Укажите "compilerPath" в c_cpp_properties.json.
cpptools/queryCompilerDefaults: 1
Попытка получить значения по умолчанию из обнаруженного на компьютере компилятора: "".
Подходящий компилятор не найден. Укажите "compilerPath" в c_cpp_properties.json.
textDocument/didOpen
textDocument/didOpen
textDocument/didOpen
cpptools/activeDocumentChange
cpptools/activeDocumentChange
cpptools/textEditorSelectionChange
textDocument/didOpen
cpptools/didChangeFolderSettings
Попытка получить значения по умолчанию из обнаруженного на компьютере компилятора: "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe".
Служба обзора кода инициализирована
Попытка получить значения по умолчанию из обнаруженного на компьютере компилятора: "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe".
  Папка C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2017/BUILDTOOLS/VC/TOOLS/MSVC/14.16.27023/INCLUDE/* будет индексироваться
  Папка C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2017/BUILDTOOLS/VC/TOOLS/MSVC/14.16.27023/ATLMFC/INCLUDE/* будет индексироваться
  Папка C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17134.0/UM/ будет индексироваться
  Папка C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17134.0/UCRT/ будет индексироваться
  Папка C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17134.0/SHARED/ будет индексироваться
  Папка C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17134.0/WINRT/ будет индексироваться
  Папка C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17134.0/CPPWINRT/ будет индексироваться
  Папка C:/PROGRAM_FILES_X86/SBISPLATFORMSDK_19710/INCLUDE/ будет индексироваться
  Папка C:/USERS/MV.KAPITONOV/.CONAN/DATA/BOOST/1.61.0D/SBIS/STABLE/PACKAGE/538B615A9784339BE9558CE09684B63630891779/INCLUDE/ будет индексироваться
  Папка D:/D/W/CONTROLLER/ будет индексироваться
Заполните кэш завершения включения.
textDocument/didOpen
Идет обнаружение файлов...
textDocument/didOpen
Проверка на наличие синтаксических ошибок: file:///d%3A/D/w/controller/service-sbis-presto/sbis-presto-mobile/implementation/djinni_impl/table/table_sales_guests_list_o_c_impl.h
textDocument/didOpen
Проверка на наличие синтаксических ошибок: file:///d%3A/D/w/controller/service-sbis-presto/sbis-presto-mobile/implementation/djinni_impl/table/table_sales_guests_positions_list_o_c_impl.h
textDocument/didOpen
cpptools/clearCustomConfigurations
Проверка на наличие синтаксических ошибок: file:///d%3A/D/w/controller/service-sbis-presto/sbis-presto-mobile/implementation/djinni_impl/table/table_sales_guests_list_o_c_impl.cpp
cpptools/getCodeActions: 2
cpptools/getDocumentSymbols: 3
cpptools/getDocumentSymbols
Отправка аргументов компиляции для D:\D\W\CONTROLLER\SERVICE-SBIS-PRESTO\SBIS-PRESTO-MOBILE\IMPLEMENTATION\DJINNI_IMPL\TABLE\TABLE_SALES_GUESTS_LIST_O_C_IMPL.CPP.
  Включить: D:\D\W\CONTROLLER\SERVICE-SBIS-PRESTO\SBIS-PRESTO-MOBILE
  Включить: D:\D\W\CONTROLLER\SERVICE-SBIS-PRESTO\SBIS-PRESTO-MOBILE\IMPLEMENTATION
  Включить: C:\PROGRAM_FILES_X86\SBISPLATFORMSDK_19710\INCLUDE
  Включить: D:\D\W\CONTROLLER\SERVICE-SBIS-PRESTO\LIBS\PPLX-LIB\INCLUDE
  Включить: D:\D\W\CONTROLLER\SERVICE-SBIS-COMMON\LIBS\LINQCPP\INCLUDE
  Включить: D:\D\W\CONTROLLER\WAITER\BN\CMAKE\DEFAULTDEBUG\DEFAULT\SUBPROJECTS\CONTROLLER\SERVICE-SBIS-PRESTO\SBIS-PRESTO-MOBILE\DJINNI
  Включить: D:\D\W\CONTROLLER\WAITER\BN\CMAKE\DEFAULTDEBUG\DEFAULT\SUBPROJECTS\CONTROLLER\SERVICE-SBIS-PRESTO\SBIS-PRESTO-MOBILE\DJINNI\CPP
  Включить: D:\D\W\CONTROLLER\RIGHTS\SBIS-AUTH-SERVICE
  Включить: D:\D\W\CONTROLLER\WAITER\BN\CMAKE\DEFAULTDEBUG\DEFAULT\SUBPROJECTS\CONTROLLER\RIGHTS\SBIS-AUTH-SERVICE\DJINNI\CPP
  Включить: D:\D\W\CONTROLLER\SERVICE-SBIS-COMMON\SBIS-MOBILE-COMMON
  Включить: D:\D\W\CONTROLLER\WAITER\BN\CMAKE\DEFAULTDEBUG\DEFAULT\SUBPROJECTS\CONTROLLER\SERVICE-SBIS-COMMON\SBIS-MOBILE-COMMON\DJINNI\CPP
  Включить: D:\D\W\CONTROLLER\SERVICE-SBIS-PRICING\SBIS-PRICING-MOBILE
  Включить: D:\D\W\CONTROLLER\WAITER\BN\CMAKE\DEFAULTDEBUG\DEFAULT\SUBPROJECTS\CONTROLLER\SERVICE-SBIS-PRICING\SBIS-PRICING-MOBILE\DJINNI\CPP
  Включить: C:\USERS\MV.KAPITONOV\.CONAN\DATA\BOOST\1.61.0E\SBIS\STABLE\PACKAGE\538B615A9784339BE9558CE09684B63630891779\INCLUDE
  Включить: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\BUILDTOOLS\VC\TOOLS\MSVC\14.16.27023\INCLUDE
  Включить: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\BUILDTOOLS\VC\TOOLS\MSVC\14.16.27023\ATLMFC\INCLUDE
  Включить: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.17134.0\UM
  Включить: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.17134.0\UCRT
  Включить: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.17134.0\SHARED
  Включить: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.17134.0\WINRT
  Включить: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.17134.0\CPPWINRT
  определите: BOOST_ALL_NO_LIB
  определите: BOOST_ENABLE_ASSERT_HANDLER
  определите: BOOST_FILESYSTEM_DEPRECATED
  определите: BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
  определите: BOOST_MPL_LIMIT_LIST_SIZE=30
  определите: BOOST_THREAD_USE_DLL
  определите: BOOST_USE_WINDOWS_H
  определите: BUILDING_PRESTO_DLL
  определите: BUILDING_SBIS_PRESTO_MOBILE
  определите: CPPREST_FORCE_PPLX
  определите: CURRENT_MODULE_NAME=sbis-presto-mobile
  определите: NDEBUG
  определите: NOGDI
  определите: NOMINMAX
  определите: NTDDI_VERSION=0x06000000
  определите: SBIS_CLANG
  определите: SBIS_DEBUG
  определите: SBIS_I686
  определите: SBIS_RELEASE
  определите: SBIS_UNIT_TESTS
  определите: SBIS_USE_WIDE_STRINGS
  определите: SBIS_WINDOWS
  определите: UNICODE
  определите: WIN32
  определите: WIN32_CLANG
  определите: WINAPP
  определите: WINVER=0x0600
  определите: _ASYNCRT_EXPORT
  определите: _CRT_NONSTDC_NO_WARNINGS
  определите: _CRT_SECURE_NO_WARNINGS
  определите: _ENABLE_ATOMIC_ALIGNMENT_FIX
  определите: _HAS_AUTO_PTR_ETC=1
  определите: _ITERATOR_DEBUG_LEVEL=0
  определите: _NDEBUG
  определите: _PPLX_EXPORT
  определите: _SCL_SECURE_NO_WARNINGS
  определите: _UNICODE
  определите: _WIN32_WINNT=0x0600
  определите: _WINDOWS
  определите: _WINSOCK_DEPRECATED_NO_WARNINGS
  определите: sbis_presto_mobile_EXPORTS
  определите: WIN32
  определите: _WINDOWS
  определите: EBUG
  stdver: ms_c++17
  intelliSenseMode: msvc-x64
Завершение работы сервера IntelliSense: D:\D\W\CONTROLLER\SERVICE-SBIS-PRESTO\SBIS-PRESTO-MOBILE\IMPLEMENTATION\DJINNI_IMPL\TABLE\TABLE_SALES_GUESTS_LIST_O_C_IMPL.CPP
пустой цикл: повторный анализ активного документа
Проверка на наличие синтаксических ошибок: file:///d%3A/D/w/controller/service-sbis-presto/sbis-presto-mobile/implementation/djinni_impl/table/table_sales_guests_list_o_c_impl.cpp
  Обработка папки (без рекурсии): C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2017/BUILDTOOLS/VC/TOOLS/MSVC/14.16.27023/INCLUDE
  Обработка папки (без рекурсии): C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2017/BUILDTOOLS/VC/TOOLS/MSVC/14.16.27023/ATLMFC/INCLUDE
  Обработка папки (с рекурсией): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17134.0/UM/
  Обработка папки (с рекурсией): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17134.0/UCRT/
  Обработка папки (с рекурсией): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17134.0/SHARED/
  Обработка папки (с рекурсией): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17134.0/WINRT/
  Обработка папки (с рекурсией): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17134.0/CPPWINRT/
Выполняется закрытие канала связи.
  Обработка папки (с рекурсией): C:/PROGRAM_FILES_X86/SBISPLATFORMSDK_19710/INCLUDE/
  Обработка папки (с рекурсией): C:/USERS/MV.KAPITONOV/.CONAN/DATA/BOOST/1.61.0D/SBIS/STABLE/PACKAGE/538B615A9784339BE9558CE09684B63630891779/INCLUDE/
  Обработка папки (с рекурсией): D:/D/W/CONTROLLER/
  Обнаружение файлов: обработано файлов — 142224.
  Файлов, удаленных из базы данных: 0
Обнаружение файлов завершено.
Выполняется анализ открытых файлов...
Анализ оставшихся файлов...
  Анализ: обработано файлов — 0
Анализ оставшихся файлов завершен.
initialized
workspace/didChangeConfiguration
Подсистема IntelliSense: Default.
Автозавершение включено.
Расширенная раскраска включена.
Волнистые линии для ошибок включены.
Исключение файла: **/.git
Исключение файла: **/.svn
Исключение файла: **/.hg
Исключение файла: **/CVS
....
......

@sean-mcmanus
Copy link
Contributor

Your loggingLevel needs to be set to the hidden value of "7" to see the new "filename cache" logging we added in Insiders (we unpublished 0.26.3-insiders though due to an unrelated crash regression, that we're hoping to have a fix for today). It sounds like you're saying the memory usage improvements didn't help?

@Gargony
Copy link

Gargony commented Dec 19, 2019

It sounds like you're saying the memory usage improvements didn't help?

Yes, didn't help.

@Gargony
Copy link

Gargony commented Dec 19, 2019

Here output with log level 7 https://onedrive.live.com/?authkey=%21AM6QU1hT82fXAYo&id=1334E82741EE192F%21398850&cid=1334E82741EE192F (see Output.txt)

  1. The output contains not all lines (limit)
  2. I see many files in unwanted locations (we have many platforms configuration)
  3. I delete other configurations and will check again

@sean-mcmanus
Copy link
Contributor

What do you mean "the output contains not all lines"? Why are you not able to add more lines to the log? We're looking for output around that has text "filename cache" because our hypothesis is that that's the new code that is causing the memory usage issue. Do you see any of that in the logs?

The log doesn't show anything interesting other than the initial file scan. How does the memory usage relate to those logs?

The code that potentially is causing the problem iterates through the files in the database and forms links between source files and header files that are incuded by the source files. Can you think of anything special with your workspace that might cause this code to loop infinitely? We have not been able to replicate this condition yet with our testing.

@Gargony
Copy link

Gargony commented Dec 27, 2019

There were no crashes after several days of observation.
So I think the reason is was in a lot of files to parse.

@Colengms
Copy link
Contributor

Colengms commented Jan 7, 2020

Hi @Gargony . How many files do you have in this project/folder? Can you tell if memory usage grew slowly over time, or spiked suddenly?

The stack you caught for this (related to populating a cache of header/source relationships) is only invoked as a header is opened, and only if there is not another file already open that includes that header (directly or indirectly). The first time this happens, or if files have been added/removed/moved since the last time, we build a table of header/source relationships, to determine a good source file to use instead of the header. That table should not be particularly large. With 50K files, I'm seeing memory usage of ~5M. Memory usage would spike suddenly. If you are not using a huge number of files, and memory usage grew steadily instead of spiking, the root cause could be a leak elsewhere, and manifesting there due to the spike..

If you can catch a full heap dump for the out of memory crash, that could be very useful. :)

@bobbrow bobbrow changed the title Connection to server got closed. Server will not be restarted" Extension process using too much memory in the filename cache Jan 8, 2020
@Colengms
Copy link
Contributor

@Gargony We believe we have a fix for this in 0.26.3-insiders3 . If you are able to repro again, could you confirm?

@Colengms Colengms added the fixed Check the Milestone for the release in which the fix is or will be available. label Jan 10, 2020
@Gargony
Copy link

Gargony commented Jan 14, 2020

@Colengms thx, I'll check it.

@sean-mcmanus
Copy link
Contributor

We shipped 0.26.3 -- we can reopen this if it still repros: https://github.com/microsoft/vscode-cpptools/releases/tag/0.26.3 .

@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed Check the Milestone for the release in which the fix is or will be available. Language Service performance
Projects
None yet
Development

No branches or pull requests

5 participants