Cocos2d engine has a memory leaks on OS X & iOS

Cocos2d engine has a memory leaks on OS X & iOS
0
#1

Hello. During the development of my game I encountered memory leaks. I have started a project profiling and figured out that these leaks occur in the core of Cocos2d engine.

For testing, I created a completely new empty project in which there is only one scene without a single layer or a node, completely empty scene like this:

Then I compiled the project and again started profiling. The result of what I saw, you can see yourself in the picture below:

As you can see completely empty scene without a single object has more than 600 memory leaks!
When I started profiling with the default “HelloWorld” project the number of memory leaks is was double increased!

The same leaks occur when I run empty new project on the real iOS device and in the iOS simulator. However, I should note that these leaks over time does not increase. They occur somewhere in the core Cocos2d engine at startup and initialization of the application. But I noticed that these leaks happen all the time, even when I create an empty scene without a single object on them. I have not conducted the same tests on Linux, Android and Windows and I do not know what’s going on these platforms. If someone else has a desire to carry out such tests on other platforms, it would be good to know the results.

Cocos2d-x-3.8beta0 is released!
#2

The memory leak is in GLFW library.

#3

This scares the hell out of me… @owen, how do you know it is the GLFW library?

Will this be fixed? I think it is something really important.

Cheers.

#4

cocos2d-x has some singletons like Director, and other cache objects, which will appear as leaks, but they are not.

Memory leaks in a fresh 3.17.1 project