memory leak tracking problem... HELP!!

Login to reply to this topic.
Wed, 2006-03-22 12:14
Joined: 2006-03-08
Forum posts: 7
The framework complains about a memory leak in my application after quitting. Hook logger gives me a stack (below) of the leaked memory cell and this hints that the memory leak is in an http connection which I have done with active objects.

BUT there's no reference in the stack to functions which I coded myself...

Is this leak actually a leak inside framework or do active objects somehow "hide" my code...? Second question: If this is a framework leak, how can I find my own leaks when the framework always complains about this leak first?

Confusing... Please help me!


-Marko-


EUSER::RHeap::AllocL + 19
EUSER::User::AllocL + 19
Expo + 11455 -EUserParasite_EKA1.dll! 1000db8f()
Expo + 12216 -EUserParasite_EKA1.dll! 1000de88()
EUSER::CBase::newL + 13
BAFL::MBackupOperationObserver::Reserved1 + 1789 -BAFL.DLL! 4010503c()
BAFL::RStringPool::StringF + 4860 -BAFL.DLL! 40116ae8()
BAFL::RStringPool::OpenFStringL + 29
Ordinal1 + 8401 -DEFLATEFILTER.DLL! 17dd336f()
Ordinal1 + 7883 -DEFLATEFILTER.DLL! 17dd3169()
HTTP::CRxData::ConstructL + 2799 -HTTP.DLL! 141ca392()
HTTP::CRxData::ConstructL + 1097 -HTTP.DLL! 141c9cec()
EUSER::CActiveScheduler::Start + 514
EUSER::CActiveScheduler::Start + 65
CONE::CCoeEnv::ExecuteD + 53
EIKCORE::EikDll::RunAppInsideThread + 282
EIKCORE::EikDll::RunAppInsideThread + 368
EUSER::User::StartThread + 25
EKERN::DSharedIoBuffer::New + 2300 -EKERN.DLL! 5b018d40()
kernel32.dll! 7c80b50b()

Wed, 2006-03-22 20:51
Joined: 2004-07-10
Forum posts: 364
Re: memory leak tracking problem... HELP!!
I have no famililarity with hook logger but looking at its output it looks like perhaps you are creating a http object in your active object, which causes a CRxData object to be created which causes an allocation within RStringPool.
So does the code in your active object delete/cleanup all the HTTP related useage properly?
Thu, 2006-03-23 08:35
Joined: 2006-03-08
Forum posts: 7
Re: memory leak tracking problem... HELP!!
Well, that's a good question and I'd like to know the answer too Smiley

Active object is dequed and the http engine is destroyed... But something may still remain. But how can you find that from a million (not quite Smiley ) lines of code, that's a problem.

BTW, I ran the program in two phones and neither of them complained of a memory leak... I think that would suggest that the leak is in the emulator's framework.

If the leak really is in the framework and the leak is the first one emulator complains, then I'm stuck... Unless someone could tell me how to spot all memory leaks at once?
Thu, 2006-03-23 09:48
Joined: 2004-11-07
Forum posts: 10
Re: memory leak tracking problem... HELP!!
Looks like the HTTPClient libraries (or BAFL) is leaving something unallocated.  It'd be nice if they cleaned up after themselves.

Try your app on S60_2nd_FP3 (feature pack 3), my experience is that the HTTP libraries play friendlier here (i.e. no memory leak).

Let us know how you go.
-Bob
Thu, 2006-03-23 19:03
Joined: 2004-07-10
Forum posts: 364
Re: memory leak tracking problem... HELP!!
Post your active object code.

P.S.
Memory leak detection isn't enabled on hardward builds.
Fri, 2006-03-24 11:41
Joined: 2006-03-08
Forum posts: 7
Re: memory leak tracking problem... HELP!!
Symbian_bob:

There's a problem with FP3. For some reason the network connection in my FP3 emulator doesn't work Sad I'll try to fix it, but I'm not hopeful (having already spent numerous hours with the problem).

Mungbeans:

Thanks, mungbeans, I didn't know that __UHEAP_MARK and MARKEND don't work on phones. I must have seen just other panic screens on phones (I'm a beginner with Symbian, so I don't spot everything). But I can't post a single line of code... My boss is rather serious about security.
Fri, 2006-03-24 18:45
Joined: 2004-07-10
Forum posts: 364
Re: memory leak tracking problem... HELP!!
There are mechanisms for tracking down code leaks, depends what IDE you have etc.
I don't have the links to hand but you should be able to find them on this website somewhere probably or on the symbian site if you search.
But just do a code review of your active object first, make sure all C objects are being deleted, all R objects are being closed etc.
  • Login to reply to this topic.