Audio RAM Usage?


#1

I’ve noticed whenever I play a sound in the game RAM usage increases ~0,1/0,3 MB. As more sound effects are played they add up and on long play sessions it increases RAM usage 100/200 MB. Is this normal behavior? Anyone else noticed this?


#2

Certainly strange. I didn’t experience any apparent memory leaks myself, and with so much people walking around Hanwell now you’d think someone would have experienced a crash if there was such an egregious leak.

Most likely this is a normal memory usage based on assets being loaded (textures, metadata, audio, videos). As long as we don’t see a dramatic increase such as 2GB, I think we’re OK :slight_smile:

Still, I’m going to add this issue on GitHub to keep track of it!


#3

This might be the normal behavior, that’s true, but I managed to increase RAM usage steadily by continuously clicking on a button that plays a sound. It takes ages to increase it 100MB, so unless players play the game for a very long time and click on everything ferociously, RAM usage won’t see 200MB.


#4

OK, it’s worrisome alright. I’ve opened an issue on GitHub to keep track of it :slight_smile:


#5

Oh shoot, I just noticed that we were talking about different versions of Dagon. My message was meant for Dagon++, not Dagonity. Sorry for the confusion, I know Dagon++ is not the main focus for you, but I’m still using it. :stuck_out_tongue:

I also noticed the same problem doesn’t exists in Serena version (it says 0.6.8a) of the engine. I didn’t test it much though. This is the only bug I’m experiencing in the 0.6.7 version of the engine right now.


#6

Ah, that makes more sense now! We didn’t experience anything of the sort in Dagonity.

But, like you say, Dagon++ has been tested in production with Serena and with very few technical problems, I should add. While Serena is a short game, a memory leak of the sort should have been noticeable as the protagonist in that game talks a lot.

I believe those fixes were pushed to GitHub alright. We didn’t create a release tag for 0.6.8, but the main branch should work perfectly fine. Are you able to compile the newest code yourself?


#7

Yes, I did compile the code a few times with some small changes to subtitle width/placement.

After testing Serena executable with my game I noticed, the bug really does not happen ('play’ing sounds creates some stack memory usage but clears itself later while in my build it stays). Now I wonder if I’m compiling it wrong somehow or changed the code somewhere I shouldn’t, but I’m pretty sure I didn’t do too much.

This is the compile log if it’s any help:

1>------ Build started: Project: Dagon, Configuration: Release x64 ------ 1> Audio.cpp 1>..\src\Audio.cpp(113): warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data 1>..\src\Audio.cpp(114): warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data 1>..\src\Audio.cpp(481): warning C4267: 'return' : conversion from 'size_t' to 'long', possible loss of data 1> AudioManager.cpp 1>..\src\AudioManager.cpp(125): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Create\Visual Studio 2012\VC\include\string.h(110) : see declaration of 'strcpy' 1>..\src\AudioManager.cpp(160): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Create\Visual Studio 2012\VC\include\string.h(110) : see declaration of 'strcpy' 1> Button.cpp 1> CameraManager.cpp 1>..\src\CameraManager.cpp(440): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data 1>..\src\CameraManager.cpp(442): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data 1>..\src\CameraManager.cpp(448): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data 1>..\src\CameraManager.cpp(450): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data 1> Config.cpp 1> Console.cpp 1>..\src\Console.cpp(89): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Create\Visual Studio 2012\VC\include\string.h(191) : see declaration of 'strncpy' 1>..\src\Console.cpp(163): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\Console.cpp(164): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\Console.cpp(165): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\Console.cpp(166): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1> Control.cpp 1>..\src\Control.cpp(537): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Create\Visual Studio 2012\VC\include\string.h(191) : see declaration of 'strncpy' 1>..\src\Control.cpp(857): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Create\Visual Studio 2012\VC\include\time.inl(112) : see declaration of 'localtime' 1> CursorManager.cpp 1>..\src\CursorManager.cpp(159): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data 1>..\src\CursorManager.cpp(160): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data 1>..\src\CursorManager.cpp(161): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data 1>..\src\CursorManager.cpp(162): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data 1>..\src\CursorManager.cpp(163): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data 1>..\src\CursorManager.cpp(164): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data 1>..\src\CursorManager.cpp(165): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data 1>..\src\CursorManager.cpp(166): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data 1> EffectsManager.cpp 1>..\src\EffectsManager.cpp(411): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data 1>..\src\EffectsManager.cpp(415): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data 1>..\src\EffectsManager.cpp(446): warning C4244: 'return' : conversion from 'uint32_t' to 'float', possible loss of data 1>..\src\EffectsManager.cpp(456): warning C4244: 'return' : conversion from 'int' to 'float', possible loss of data 1>..\src\EffectsManager.cpp(495): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Create\Visual Studio 2012\VC\include\stdio.h(218) : see declaration of 'fopen' 1>..\src\EffectsManager.cpp(504): warning C4267: '=' : conversion from 'size_t' to 'long', possible loss of data 1> FeedManager.cpp 1>..\src\FeedManager.cpp(85): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Create\Visual Studio 2012\VC\include\string.h(191) : see declaration of 'strncpy' 1>..\src\FeedManager.cpp(86): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Create\Visual Studio 2012\VC\include\string.h(191) : see declaration of 'strncpy' 1>..\src\FeedManager.cpp(113): warning C4244: 'initializing' : conversion from 'double' to 'size_t', possible loss of data 1>..\src\FeedManager.cpp(125): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Create\Visual Studio 2012\VC\include\string.h(191) : see declaration of 'strncpy' 1>..\src\FeedManager.cpp(127): warning C4308: negative integral constant converted to unsigned type 1>..\src\FeedManager.cpp(195): warning C4244: 'argument' : conversion from 'double' to 'int', possible loss of data 1>..\src\FeedManager.cpp(199): warning C4244: 'argument' : conversion from 'double' to 'int', possible loss of data 1> FontManager.cpp 1> Interface.cpp 1>..\src\Interface.cpp(78): warning C4244: 'argument' : conversion from 'double' to 'int', possible loss of data 1>..\src\Interface.cpp(93): warning C4244: 'argument' : conversion from 'double' to 'int', possible loss of data 1>..\src\Interface.cpp(133): warning C4244: 'argument' : conversion from 'double' to 'int', possible loss of data 1> Node.cpp 1> RenderManager.cpp 1>..\src\RenderManager.cpp(246): warning C4244: 'argument' : conversion from 'int' to 'GLfloat', possible loss of data 1>..\src\RenderManager.cpp(417): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\RenderManager.cpp(418): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\RenderManager.cpp(419): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\RenderManager.cpp(543): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\RenderManager.cpp(544): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\RenderManager.cpp(545): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\RenderManager.cpp(546): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\RenderManager.cpp(588): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\RenderManager.cpp(589): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\RenderManager.cpp(590): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1> Room.cpp 1> Scene.cpp 1>..\src\Scene.cpp(186): warning C4244: 'argument' : conversion from 'double' to 'int', possible loss of data 1>..\src\Scene.cpp(254): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\Scene.cpp(255): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\Scene.cpp(256): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\Scene.cpp(305): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\Scene.cpp(306): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1>..\src\Scene.cpp(307): warning C4244: 'initializing' : conversion from 'int' to 'float', possible loss of data 1> Script.cpp 1>c:\users\jokerme\desktop\dagon-0.6.7\src\CameraLib.h(95): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\CameraLib.h(121): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(177): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(186): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(189): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(192): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(210): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(213): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(216): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(222): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(225): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(228): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(234): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(237): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(240): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(243): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(246): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(249): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ConfigLib.h(255): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\AudioProxy.h(52): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ButtonProxy.h(46): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ButtonProxy.h(47): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ButtonProxy.h(58): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ButtonProxy.h(151): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ButtonProxy.h(157): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data 1>c:\users\jokerme\desktop\dagon-0.6.7\src\ImageProxy.h(82): warning C4244: 'argument' : conversion from 'lua_Number' to 'float', possible loss of data 1>c:\users\jokerme\desktop\dagon-0.6.7\src\RoomProxy.h(118): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\SlideProxy.h(68): warning C4805: '!=' : unsafe mix of type 'int' and type 'bool' in operation 1>..\src\Script.cpp(349): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>..\src\Script.cpp(353): warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data 1>..\src\Script.cpp(421): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Create\Visual Studio 2012\VC\include\string.h(191) : see declaration of 'strncpy' 1>..\src\Script.cpp(479): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>..\src\Script.cpp(482): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>..\src\Script.cpp(485): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>..\src\Script.cpp(507): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) 1>c:\users\jokerme\desktop\dagon-0.6.7\src\Luna.h(122): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Create\Visual Studio 2012\VC\include\stdio.h(357) : see declaration of 'sprintf' 1> c:\users\jokerme\desktop\dagon-0.6.7\src\Luna.h(116) : while compiling class template member function 'int Luna<T>::tostring_T(lua_State *)' 1> with 1> [ 1> T=dagon::AudioProxy 1> ] 1> c:\users\jokerme\desktop\dagon-0.6.7\src\Luna.h(37) : see reference to function template instantiation 'int Luna<T>::tostring_T(lua_State *)' being compiled 1> with 1> [ 1> T=dagon::AudioProxy 1> ] 1> c:\users\jokerme\desktop\dagon-0.6.7\src\AudioProxy.h(37) : see reference to class template instantiation 'Luna<T>' being compiled 1> with 1> [ 1> T=dagon::AudioProxy 1> ] 1> Spot.cpp 1>..\src\Spot.cpp(224): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data 1>..\src\Spot.cpp(225): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data 1>..\src\Spot.cpp(226): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data 1>..\src\Spot.cpp(227): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data 1>..\src\Spot.cpp(228): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data 1>..\src\Spot.cpp(229): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data 1>..\src\Spot.cpp(230): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data 1>..\src\Spot.cpp(231): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data 1> System.cpp 1> TextureManager.cpp 1>..\src\TextureManager.cpp(82): warning C4267: 'initializing' : conversion from 'size_t' to 'long', possible loss of data 1> Compiling... 1> TimerManager.cpp 1> VideoManager.cpp 1> main.cpp 1> Creating library C:\Users\Jokerme\Desktop\Dagon-0.6.7\visualc\\..\build\win64\release\Dagon.lib and object C:\Users\Jokerme\Desktop\Dagon-0.6.7\visualc\\..\build\win64\release\Dagon.exp 1> Generating code 1>c:\users\lenny\desktop\libtheora-1.1.1\lib\quant.c(105): warning C4701: potentially uninitialized local variable 'plj' used 1> Finished generating code 1> Dagon.vcxproj -> C:\Users\Jokerme\Desktop\Dagon-0.6.7\visualc\\..\build\win64\release\Dagon.exe ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

:frowning:


#8

Some of those warnings look funny indeed. Could you try pulling the master branch again and compiling without doing any changes?

Several things changed since the release of Serena, so it could happen that we introduced a bug. I’ll double check that as soon as I can. Just in case, this is the commit that coincides with the release of Serena, so it shouldn’t exhibit the bug: https://github.com/Senscape/Dagon/commit/8feb65facd42e792d965f95456e61bf8c403d30b


#9

I’ll try it right away.


#10

Apparently I missed a few commits. After using the new build, engine version is updated to 0.6.8a. Sorry for the false alarm :-[


#11

That’s great to hear, although I had no idea what that problem was. It broke and fixed all by itself :stuck_out_tongue:


#12

Yes, if it’s working, there is no need for a fix.

Looks like I missed quite a lot of improvements due to not using latest commits. Consequently there are some changes in scripting. I hope you don’t mind answering some more lame questions in the future Agustin, I might get stuck somewhere :smiley: For example I noticed “lookAt(X,Y,bool)” changed into “lookAt(X,Y,{instant = bool, adjustment = bool})”, but it took me a little while.

I must say though, latest state of Dagon++ is exceptionally slick.


#13

No problem, go ahead and ask away :slight_smile:

And yes, fortunately the old Dagon has reached a good level of stability and maturity. I’ll get back to it, adding more features and improvements, after we’re done with Asylum!