2

I am developing plugins and for some reason my QGIS keeps getting slower and slower. At first when I clicked on QGIS it opened right away, now it takes at least 2 minutes just to open and it also can take up to one minute just to close. Going into Manage and install plugins now times out because it takes forever to open. The way I'm pushing my changes is with this:

@echo off
SET OSGEO4W_ROOT=C:\OSGeo4W64
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat

@echo off
path %PATH%;%OSGEO4W_ROOT%\apps\qgis\bin
path %PATH%;%OSGEO4W_ROOT%\apps\grass\grass78\lib
path %PATH%;C:\OSGeo4W64\apps\Qt5\bin
path %PATH%;C:\OSGeo4W64\apps\Python37\Scripts

set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis\python
set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python37

set PATH=C:\Program Files\Git\bin;%PATH%

cmd.exe

Which is located in C:\OSGeo4W64. I then just type in pb_tool deploy in the directory of the plugin.

I tried reinstalling QGIS 3.10.7 but it didn't change anything. Also tried on QGIS 3.12 and 3.14 and it didn't change anything.

Looking for a way to fix my QGIS being so slow. My codes use a couple of files and they are quite large so I can't really post everything here, but I'm mostly using processing algorithms from qgis and grass and I use "memory:" and "TEMPORARY_OUTPUT" for QGIS and GRASS algorithms respectively.

Just tried the Plugin Load Times and it doesn't seem to be because of my plugins: enter image description here

Also here's the QGIS consumption when I just opened it and I have yet to even open a new project: enter image description here


The problem seems to be coming from my QGIS3.ini. When I create a new user it's size is only 13KB while the default one is 547,018KB. The new profile's QGIS3.ini looks like this: enter image description here

But the older one is actually insane it looks like this: enter image description here

The [UI] part contains hundreds of millions of characters by itself and I don't know why.

15
  • 1
    I know nothing about what in a plugin makes QGIS slow but I have used the Plug-in load times plugin to see what is causing QGIS to open slowly. You might want to try it and see if your plugin is causing the slowdown. – Baswein Jul 13 '20 at 15:07
  • Did you remove your plugin(s) just to see how it impact the loading speed? – ThomasG77 Jul 13 '20 at 17:10
  • @ThomasG77 Yup I tried to uninstall them and it didn't change anything. My QGIS became slow all of a sudden and I can't find a way to get it as it was before. Just tried the Plugin Load Times like Baswein recommended and it takes only 4sec for all my plugins to load. – EnGIsNowhere Jul 13 '20 at 17:15
  • 1
    What happened if you create a New Profile (e.g Settings -> User Profiles -> New Profile...) and run QGIS with it? Always slow? – ThomasG77 Jul 13 '20 at 17:54
  • 1
    It's because "New Profile" more or less a QGIS with default conf, no plugins and other things (clearly do not know all about this) You can go to Settings -> User Profiles -> Open Active Profile Folder and do it for both your profiles and then can try to sort out why it's so slow by comparing contents from both folders. More a beginning to track the memory issue but at least a clue. – ThomasG77 Jul 13 '20 at 18:04
6

More a guide than a definitive answer. It's a structured compilation of comments from the post.

Try to find out why it's slow by using

  • a plugin called "Plugin Load Times" to see plugins loading consumption. Be careful as stated in the plugin description

    It does not give you information about the speed of plugins when they are used.

  • try to disable all your plugins to track if any memory leak somewhere

  • see your overall memory consumption (using Windows Task Manager if Windows; use glances, top or ps on Linux; use OSX Task Manager for Mac)

  • try to create a new user profile and use QGIS with it going to "Settings -> User Profiles -> New Profile...". If it works, try to compare both Profile folders by opening both of them using "Settings -> User Profiles -> Open Active Profile Folder". Profiles are more or less like a reset, you need to reinstall plugins. They can be useful if you have different QGIS user profiles in your company. Some people do only drawing: hide to them most buttons not for edition. Some other does only need to consult, give them only buttons to browse, click informations and select features, ...

4

So after taking into account what ThomasG77 told me to fix my QGIS, I've found that indeed creating a new profile fixes the slowdown, but I didn't want to have to create a new profile everytime it got this slow, then reinstall my plugins,etc. The problem does seem to lie with the QGIS3.ini which kept getting bigger and bigger (After creating a new profile I saw that the default QGIS3.ini which I was using was 42000 times bigger than the one that you begin with from scratch).

However I found a simple solution to fix it without having to delete anything or create a new profile. You simply need to open QGIS, go in Settings > Options... > System. Then under "Settings" you'll see this: enter image description here

I tried it and this not only reset my QGIS3.ini from 547k KB to 59KB, but it also kept all of the plugins I'd installed. Now it opens super fast again and everything works as it should.

Alternatively, creating a new profile does work if you're scared that doing the reset will affect some changes you've made, but as for myself the reset accomplished everything I needed it to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.