vscode-odoo
vscode-odoo copied to clipboard
High CPU usage after installing the extension
I am using:
Name: Odoo IDE Id: trinhanhngoc.vscode-odoo Description: Odoo Framework Integration for Visual Studio Code Version: 0.30.1 Publisher: Trịnh Anh Ngọc VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=trinhanhngoc.vscode-odoo
Version: 1.91.1 (system setup) Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729 Date: 2024-07-09T22:06:49.809Z Electron: 29.4.0 ElectronBuildId: 9728852 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Windows_NT x64 10.0.22000
Docker Desktop 4.32.0 (157355) with
WSL version: 2.2.4.0 Kernel version: 5.15.153.1-2 WSLg version: 1.0.61 MSRDC version: 1.2.5326 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26091.1-240325-1447.ge-release Windows version: 10.0.22000.2538
in my code-workspace I have setup like this:
"python.analysis.extraPaths": [
"/usr/lib/python3/dist-packages/odoo",
"/usr/lib/python3/dist-packages/odoo/addons",
"/mnt/extra-addons/"
],
"python.analysis.typeCheckingMode": "off",
"python.autoComplete.extraPaths": [
"/usr/lib/python3/dist-packages/odoo",
"/usr/lib/python3/dist-packages/odoo/addons",
"/mnt/extra-addons/"
],
I am working with odoo inside a container. As soon as I install the extension, it will start building a cache with high CPU usage to the point of disconnecting me from the remote container. Once that happens I keep waiting and waiting and nothing happens but the high CPU remains.
Can you recommend a fix or advise if I am doing something wrong?
@sel-carlitos
At the first time you open a project, the plugin needs to index all files in the project. One done, the plugin will index only new or changed files. Do you see the index progress in the status bar?
I've been using the extension for the last 6 months and it was not like this before. I left the thing running for an hour before going to bed. I just came back to work and it has finished indexing. Is there a way to have indexing but not kill the usability of docker? My docker desktop and all the other containers (db, nginx, etc...) go useless while this happens. Can you recommend vscode settings that I should have in place?
I have set my workspace as follows:
"folders": [
{
"path": "."
},
{
"path": "../../etc/odoo",
"name": "config"
},
{
"path": "../extra-addons"
},
{
"path": "../../var/lib/odoo",
"name": "filestore"
},
{
"path": "../../usr/lib/python3/dist-packages/odoo",
"name": "sources"
}
],
For my settings, I also have these that don't think are the problem:
"git.autofetch": true,
"git.autoRepositoryDetection": false,
"git.enableSmartCommit": false,
"git.detectSubmodules": false,
"git.scanRepositories": [
"/mnt/extra-addons/"
],
Or could it be possible to control how much CPU the indexing should take so that it runs in the background without taking over as the only process that can run?
I forgot to answer your question: "Do you see the index progress in the status bar?"
Answer: I do see the spinning at the bottom. I used to see it go through to 100% without the container, docker, or vscode becoming unusable. Now, when it gets around 10-15% vscode starts trying to reconnect to the docker container. I don't know how long it took but yesterday I hung around for about 1 hour before calling it quits for the day. Today I have started without any issues. But I hope there is a way to control the indexing.
I love your extension. I used to work with it in Pycharm but I became a vscode fan and haven't looked back.
I gave more RAM to the container and now it's working well.
It takes 2-3 min to complete but you can work with the other containers and vscode without haning.
@sel-carlitos ,
It's nice to hear that you found a way to get the extension working well. I am curious about the previous RAM amount that caused the problem.
It was 2GB RAM for the container. I now let it use whatever it needs as it's my dev machine.