Hi all!
I’m attempting to track down the root cause of a memory leak on our IOS game, but have hit the limits of my knowledge. Here’s what I’m seeing (openfl 2.2.7, lime 2.1.2) -
0 libsystem_kernel.dylib mach_vm_map
1 GLEngine allocateWCMemory
2 GLEngine glBufferData_Exec
3 CineMagic nme::OGLContext::RenderData(nme::HardwareData const&, nme::ColorTransform const*, float const (&) [4][4])
4 CineMagic nme::Graphics::Render(nme::RenderTarget const&, nme::RenderState const&)
5 CineMagic nme::DisplayObject::Render(nme::RenderTarget const&, nme::RenderState const&)
6 CineMagic nme::DisplayObjectContainer::Render(nme::RenderTarget const&, nme::RenderState const&)
7 CineMagic nme::DisplayObjectContainer::Render(nme::RenderTarget const&, nme::RenderState const&)
8 CineMagic nme::DisplayObjectContainer::Render(nme::RenderTarget const&, nme::RenderState const&)
9 CineMagic nme::DisplayObjectContainer::Render(nme::RenderTarget const&, nme::RenderState const&)
10 CineMagic nme::DisplayObjectContainer::Render(nme::RenderTarget const&, nme::RenderState const&)
11 CineMagic nme::DisplayObjectContainer::Render(nme::RenderTarget const&, nme::RenderState const&)
12 CineMagic nme::DisplayObjectContainer::Render(nme::RenderTarget const&, nme::RenderState const&)
13 CineMagic nme::DisplayObjectContainer::Render(nme::RenderTarget const&, nme::RenderState const&)
14 CineMagic nme::Stage::RenderStage()
15 CineMagic nme_render_stage(_value*)
16 CineMagic ExternalPrimitive::__run(Dynamic const&) /usr/lib/haxe/lib/hxcpp/3,1,68/src/hx/Lib.cpp:122
17 CineMagic Dynamic::operator()(Dynamic const&) /usr/lib/haxe/lib/hxcpp/3,1,68/include/Dynamic.h:176
18 CineMagic openfl::_v2::display::Stage_obj::__render(bool) ./src/openfl/_v2/display/Stage.cpp:1707
19 CineMagic openfl::_v2::display::Stage_obj::__checkRender() ./src/openfl/_v2/display/Stage.cpp:610
20 CineMagic openfl::_v2::display::Stage_obj::__pollTimers() ./src/openfl/_v2/display/Stage.cpp:1672
21 CineMagic openfl::_v2::display::Stage_obj::__doProcessStageEvent(Dynamic) ./src/openfl/_v2/display/Stage.cpp:688
22 CineMagic openfl::_v2::display::Stage_obj::__processStageEvent(Dynamic) ./src/openfl/_v2/display/Stage.cpp:891
23 CineMagic openfl::_v2::display::__Stage_obj__processStageEvent(hx::Object*, Dynamic const&) ./src/openfl/_v2/display/Stage.cpp:897
24 CineMagic hx::CMemberFunction1::__run(Dynamic const&) /usr/lib/haxe/lib/hxcpp/3,1,68/include/hx/DynamicImpl.h:138
25 CineMagic val_call1 /usr/lib/haxe/lib/hxcpp/3,1,68/src/hx/CFFI.cpp:602
26 CineMagic external_handler(nme::Event&, void*)
27 CineMagic nme::Stage::HandleEvent(nme::Event&)
28 CineMagic IOSStage::OnPoll()
29 CineMagic -[NMEAppDelegate mainLoop]
30 Foundation __NSThreadPerformPerform
31 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
32 CoreFoundation __CFRunLoopDoSources0
33 CoreFoundation __CFRunLoopRun
34 CoreFoundation CFRunLoopRunSpecific
35 CineMagic -[NMEAppDelegate mainLoop]
36 Foundation __NSThreadPerformPerform
37 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
38 CoreFoundation __CFRunLoopDoSources0
39 CoreFoundation __CFRunLoopRun
40 CoreFoundation CFRunLoopRunSpecific
41 CineMagic -[NMEAppDelegate mainLoop]
42 Foundation __NSThreadPerformPerform
43 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
44 CoreFoundation __CFRunLoopDoSources0
45 CoreFoundation __CFRunLoopRun
46 CoreFoundation CFRunLoopRunSpecific
47 GraphicsServices GSEventRunModal
48 UIKit UIApplicationMain
49 CineMagic nme::CreateMainFrame(void (*)(nme::Frame*), int, int, unsigned int, char const*, nme::Surface*)
50 CineMagic nme_create_main_frame(_value**, int)
51 CineMagic ExternalPrimitive::__Run(Array<Dynamic> const&) /usr/lib/haxe/lib/hxcpp/3,1,68/src/hx/Lib.cpp:159
52 CineMagic Dynamic::operator()(Dynamic const&, Dynamic const&, Dynamic const&, Dynamic const&, Dynamic const&, Dynamic const&) /usr/lib/haxe/lib/hxcpp/3,1,68/include/hx/DynamicImpl.h:542
53 CineMagic openfl::_v2::Lib_obj::create(Dynamic, int, int, hx::Null<double>, hx::Null<int>, hx::Null<int>, String, hx::ObjectPtr<openfl::_v2::display::BitmapData_obj>, hx::ObjectPtr<Class_obj>) ./src/openfl/_v2/Lib.cpp:321
54 CineMagic ApplicationMain_obj::main() ./src/ApplicationMain.cpp:177
55 CineMagic __hxcpp_lib_main ./src/__lib__.cpp:12
56 CineMagic hxRunLibrary /usr/lib/haxe/lib/hxcpp/3,1,68/src/hx/RunLibs.cpp:29
57 CineMagic main /Users/bbooth/work/hs_client/HollywoodShuffle/export/ios/CineMagic/Classes/Main.mm:121
58 libdyld.dylib start
I see lots of these, around 10MB worth over 20min, just enough to put the game over the edge. So I guess my ask is:
- How should I start figuring out the root cause of the leak?
- Barring that, is there a way to forcibly clear GLEngine allocated memory (crazy, I know )
Thanks!