GDIDE Events tab - with a project open uses 50% cpu [solved]

I am not sure why, but the editor is taking quite a lot of CPU - even when in idle state. The editor has a simple html5 project open, and it is not running the game or doing anything.

When I initially launch gdide, it doesnt use up so much cpu (4-10%) . Even when I load the project it doesnt. But for some reason after a few minutes of using the editor, it starts eating up a lot of cpu and continues to do so until I close it completely. (over 50%))

Another curious thing, While the editor is not crashed, while it uses so much cpu it doesnt want to close. I have to forcefully kill it’s process.

EDIT: I noticed that it drops back down to 7% once in a while. There is a bottleneck somewhere and I am trying to figure out where

EDIT: It seems to switch to eating a lot of CPU when I am in the events tab.
It stops eating a lot of cpu when I switch to the scene tab.(3-7% cpu)
When I switch back to the Events tab, the cpu is crazy again (consistent at 50%^ cpu)

Never saw that problem before (I use GD on Linux without any problems)
You are on Linux, right ?
If it’s the case, launch GD with gdb by doing these commands :

cd /opt/gdevelop (or where GD is) export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. gdb GDIDE run

Then, when it crashes, post the content of this command :

bt

I already said that it does not crash. Just eats up a lot of CPU when in the events tab.
Yeah, I am on linux (manjaro- arch based - latest), using your package from the opensuse build service.

I can recall having the same problem with the converted deb file i used in the past as well.

Will the way you propose give any feedback on where the CPU is being wasted? :astonished:
Here is what I get in terminal:

[fox@darkstar ~]$ cd /opt/gdevelop
[fox@darkstar gdevelop]$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
[fox@darkstar gdevelop]$ gdb GDIDE
GNU gdb (GDB) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from GDIDE...(no debugging symbols found)...done.
(gdb) run
Starting program: /opt/gdevelop/GDIDE 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
GDevelop initialization started:
* Config file set.
* Language loaded
* Single instance handling done
* Image handlers loaded
* Crash management ended
* Splash Screen created
* Displaying GDevelop version information :
GDevelop 3.6.78.0, built 25/01/2015
* Creating a useless SFML texture
* Removing CppPlatform/Extensions/AStarAutomatism.xgdle
* Loading platforms and extensions:
Loading platform libGDCpp.so...
* Setting up events compiler...
* Loading events code compiler configuration
* Loading builtin extensions... BuiltinObject, Sprite, BuiltinCommonInstructions, BuiltinCommonConversions, BuiltinVariables, BuiltinMouse, BuiltinKeyboard, BuiltinJoystick, BuiltinScene, BuiltinTime, BuiltinMathematicalTools, BuiltinCamera, BuiltinAudio, BuiltinFile, BuiltinNetwork, BuiltinWindow, BuiltinStringInstructions, BuiltinAdvanced, BuiltinExternalLayouts, done.
Loading of libGDCpp.so done.
Registration in platform manager of libGDCpp.so done.
Loading extensions for GDevelop C++ platform... Network, Light, PrimitiveDrawing, PhysicsAutomatism, SoundObject, LinkedObjects, Function, TextObject, TimedEvent, DestroyOutsideAutomatism, CommonDialogs, PathAutomatism, PanelSpriteObject, AES, ParticleSystem, DraggableAutomatism, TiledSpriteObject, TextEntryObject, PlatformAutomatism, TileMapObject, AdvancedXML, TopDownMovementAutomatism, Box3DObject, PathfindingAutomatism,  done. 
Loading platform ./JsPlatform/libGDJS.so...
* Loading builtin extensions... BuiltinObject, Sprite, BuiltinCommonInstructions, BuiltinCommonConversions, BuiltinVariables, BuiltinMouse, BuiltinKeyboard, BuiltinJoystick, BuiltinScene, BuiltinTime, BuiltinMathematicalTools, BuiltinCamera, BuiltinAudio, BuiltinFile, BuiltinNetwork, BuiltinWindow, BuiltinStringInstructions, BuiltinAdvanced, BuiltinExternalLayouts, done.
done.
Loading of ./JsPlatform/libGDJS.so done.
Registration in platform manager of ./JsPlatform/libGDJS.so done.
Loading extensions for GDevelop JS platform... Unable to open Extensions (./JsPlatform/Extensions/) directory.
Loading extensions for GDevelop JS platform... PrimitiveDrawing, PhysicsAutomatism, LinkedObjects, TextObject, DestroyOutsideAutomatism, PanelSpriteObject, DraggableAutomatism, TiledSpriteObject, TextEntryObject, PlatformAutomatism, TopDownMovementAutomatism, PathfindingAutomatism,  done. 
* Platform and extensions loading ended.
* Creating main window
* Connecting shortcuts
* Setting help provider
* Loading events editor configuration
* Connecting parameters editors
* Creating log file (if activated)
* Initializing platforms...
 * Starting web server...
* Initialization ended.
Asking for update info: http://www.compilgames.net/update/?p=GD&l=&v=3.6.78.0
GDevelop on GitHub
Try GDevApp, the online game creator based on GD
https://github.com/4ian/GD
https://gdevapp.com?utm_source=software&utm_medium=link_en&utm_campaign=launch
Sending analytics data...done (201)

(GDIDE:9445): Gtk-WARNING **: Unable to show '-': Operation not supported
Unable to get attribute 'idVendor'. Could not find parent USB device for joystick at index 0
Unable to get attribute 'idProduct'. Could not find parent USB device for joystick at index 0

(GDIDE:9445): Gtk-CRITICAL **: IA__gtk_widget_set_size_request: assertion 'width >= -1' failed

(GDIDE:9445): Gtk-CRITICAL **: IA__gtk_widget_set_size_request: assertion 'width >= -1' failed
[Thread 0x7ffff7f74940 (LWP 9445) exited]

Program terminated with signal SIGKILL, Killed.
The program no longer exists.
(gdb) bt
No stack.
(gdb) 

But as said, it’s not crashing, just eating a lot of cpu and not wanting to close when doing so.
The terminal doesnt seem to be giving me any new messages when entering the Events tab, so I still have no idea why its eating so much cpu when in the Events tab.

Maybe the events are rendered without interruption… It’s hard to guess what could be going wrong in fact. :frowning:

You say that it drops after a while : it might be the compiler (if you are editing a native game).

Oh yes, it can simply be the compiler working. In which case this is not a bug at all :slight_smile:

Its a html5 game. Its not the compiler, the events tab is just a cpu hog. Its leaking somewhere obviously.

It doesnt drop after a while. It drops immediatelly after I switch out of the events tab. While in the events tab, it consistently uses 50-70% cpu, making my laptop overheat.

I can reproduce this problem on Ubuntu (GDevelop uses 25% of the CPU, a full core, when it’s in the event tab). I’ll try to investigate the issue.

Ok. If this isn’t related to compilation, what I can think of is an non stopping redrawing of events. Let me know Victor if you find anything relevant :slight_smile:

Thank you. I hope you manage to identify the cause. Will be looking forward to compiling it from github and testing when you do.

Is there anything I can do to help find the problem? I really hope this bug gets squashed by next release. You can really notice it on a laptop machine.

victor solved this!! :smiley: