PPA

[patch] 0.3.0 memory leak in HubFrame.h

5 posts in this topic

Index: C:/VC8/projects/trunk/ApexDC/windows/HubFrame.h

===================================================================

--- C:/VC8/projects/trunk/ApexDC/windows/HubFrame.h (revision 186)

+++ C:/VC8/projects/trunk/ApexDC/windows/HubFrame.h (working copy)

@@ -379,6 +379,7 @@

dcassert(frames[server] == this);

frames.erase(server);

+ clearUserList(); //[+]PPA

clearTaskList();

}

Log Visual Leak Detector (VLD):

---------- Block 5664 at 0x0288BBB0: 48392 bytes ----------

Call Stack:

c:\program files\microsoft visual studio 8\stlport\stlport\stl\_new.h (151): stlp_std::__stl_new

c:\program files\microsoft visual studio 8\stlport\src\allocators.cpp (68): __stlp_chunk_malloc

c:\program files\microsoft visual studio 8\stlport\src\allocators.cpp (545): stlp_std::__node_alloc_impl::_S_chunk_alloc

c:\program files\microsoft visual studio 8\stlport\src\allocators.cpp (466): stlp_std::__node_alloc_impl::_S_refill

c:\program files\microsoft visual studio 8\stlport\src\allocators.cpp (445): stlp_std::__node_alloc_impl::_M_allocate

c:\program files\microsoft visual studio 8\stlport\src\allocators.cpp (699): stlp_std::__node_alloc::_M_allocate

c:\program files\microsoft visual studio 8\stlport\stlport\stl\_alloc.h (201): stlp_std::__node_alloc::allocate

c:\program files\microsoft visual studio 8\stlport\stlport\stl\_alloc.h (376): stlp_std::allocator<stlp_std::priv::_Rb_tree_node<stlp_std::pair<short const ,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char> > > > >::allocate

c:\program files\microsoft visual studio 8\stlport\stlport\stl\_alloc.h (611): stlp_std::allocator<stlp_std::priv::_Rb_tree_node<stlp_std::pair<short const ,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char> > > > >::allocate

c:\program files\microsoft visual studio 8\stlport\stlport\stl\_tree.h (312): stlp_std::allocator<stlp_std::priv::_Rb_tree_node<stlp_std::pair<short const ,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char> > > > >::allocate

c:\program files\microsoft visual studio 8\stlport\stlport\stl\_tree.h (323): stlp_std::allocator<stlp_std::priv::_Rb_tree_node<stlp_std::pair<short const ,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char> > > > >::allocate

c:\program files\microsoft visual studio 8\stlport\stlport\stl\_tree.c (637): stlp_std::allocator<stlp_std::priv::_Rb_tree_node<stlp_std::pair<short const ,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char> > > > >::allocate

c:\program files\microsoft visual studio 8\stlport\stlport\stl\_tree.c (334): stlp_std::allocator<stlp_std::priv::_Rb_tree_node<stlp_std::pair<short const ,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char> > > > >::allocate

c:\program files\microsoft visual studio 8\stlport\stlport\stl\_map.h (153): stlp_std::allocator<stlp_std::priv::_Rb_tree_node<stlp_std::pair<short const ,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char> > > > >::allocate

c:\vc8\projects\trunk\apexdc\client\user.h (109): Identity::operator=

c:\vc8\projects\trunk\apexdc\windows\userinfo.h (91): UserInfo::setIdentity

c:\vc8\projects\trunk\apexdc\windows\userinfo.cpp (93): UserInfo::update

c:\vc8\projects\trunk\apexdc\windows\userinfo.h (82): UserInfo::UserInfo

c:\vc8\projects\trunk\apexdc\windows\hubframe.cpp (651): HubFrame::updateUser

c:\vc8\projects\trunk\apexdc\windows\hubframe.cpp (724): HubFrame::onSpeaker

c:\vc8\projects\trunk\apexdc\windows\hubframe.h (76): HubFrame::ProcessWindowMessage

c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlwin.h (3073): ATL::CWindowImplBaseT<WTL::CMDIWindow,ATL::CWinTraits<1456406528,64> >::WindowProc

0x77D48734 (File and line number not available): GetDC

0x77D48816 (File and line number not available): GetDC

0x77D489CD (File and line number not available): GetWindowLongW

0x77D48A10 (File and line number not available): DispatchMessageW

c:\vc8\projects\trunk\wtl\atlapp.h (719): WTL::CMessageLoop::Run

c:\vc8\projects\trunk\apexdc\windows\main.cpp (428): Run

c:\vc8\projects\trunk\apexdc\windows\main.cpp (520): wWinMain

f:\rtm\vctools\crt_bld\self_x86\crt\src\crt0.c (315): __tmainCRTStartup

f:\rtm\vctools\crt_bld\self_x86\crt\src\crt0.c (187): wWinMainCRTStartup

0x7C816FD7 (File and line number not available): RegisterWaitForInputIdle

Share this post


Link to post
Share on other sites

does this memory leak disappears from detector when you use your fix? because if you check the code, you will see that "clearUserList()" is called in onClose routine in HubFrame.cpp

Share this post


Link to post
Share on other sites

I'm not sure if this is also causing what I have observed.

On opening Apex, the memory used is about 64Mb. After a 14 hour session it has grown to 124Mb. Watching the performance graph in procces explorer shows that there is a steady increase in the private memory used.

I have some screen shots if they help.

Share this post


Link to post
Share on other sites

i've tested it, but there's no memory leak.

If I make the change which PPA proposed, it does nothing :)

Share this post


Link to post
Share on other sites

currently i have noticed a few users who are using the Apex PR3, and are talking about SERIOUS jumps in mem usage, yet at this point, I have not been able to pinpoint exactly whats in common with each user who has this problem. however, in most cases, reinstalling the program. launching then closing and copying settings folder data back in. seems to have worked. why? I have NO clue. about 98% success rate though.

Share this post


Link to post
Share on other sites