×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Regular Contributor
    Join Date
    May 2008
    Posts
    139

    Memory Leak in RHTTPTransaction

    I see some memory leaks in RHTTPTransaction.

    Here is code snippet

    iTrans = iSess.OpenTransactionL(uri, *iTransObs, aMethod);
    ..
    ...
    iTrans.SubmitL();
    CActiveScheduler::Start();

    Immediately after iTrans.SubmitL() and in MHFRunL callback function, I can see that significant RAM is consumed. However, after completion of SubmitL, there is a portion of RAM which remains unrecovered.

    Any information.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Memory Leak in RHTTPTransaction

    RHTTP... stuff uses string tables, that can be a cause for example.

  3. #3
    Regular Contributor
    Join Date
    May 2008
    Posts
    139

    Re: Memory Leak in RHTTPTransaction

    Quote Originally Posted by wizard_hu_ View Post
    RHTTP... stuff uses string tables, that can be a cause for example.
    Posible, but user does not have any control over it, isn't?

    Interestingly, it is always in multiple of 8192 and varies from 8192 to 32768

    Is there something can be done solve it?

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Memory Leak in RHTTPTransaction

    It may disappear when you Close the transaction. Do you get an ALLOC panic actually?

  5. #5
    Regular Contributor
    Join Date
    May 2008
    Posts
    139

    Re: Memory Leak in RHTTPTransaction

    Quote Originally Posted by wizard_hu_ View Post
    It may disappear when you Close the transaction. Do you get an ALLOC panic actually?
    Wiz, transaction is closed properly in various conditons in MHFRunL. As you said, it does recover memory but not completely. Other ideas?

    case THTTPEvent::ESucceeded:
    {
    aTransaction.Close();
    RequestCompleted(aEvent.iStatus);
    } break;
    case THTTPEvent::EFailed:
    {
    aTransaction.Close();
    RequestCompleted(aEvent.iStatus);
    } break;

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Memory Leak in RHTTPTransaction

    Do you get an ALLOC panic when you close your application in the emulator (having panic messages enabled, of course)? Transient memory allocation of system components is hard to influence.

  7. #7
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Memory Leak in RHTTPTransaction

    There will be significant amounts of RAM consumed if the session is still open as this has all sorts of tables and the bearer open.
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  8. #8
    Regular Contributor
    Join Date
    May 2008
    Posts
    139

    Re: Memory Leak in RHTTPTransaction

    Quote Originally Posted by Paul.Todd View Post
    There will be significant amounts of RAM consumed if the session is still open as this has all sorts of tables and the bearer open.
    Thanks Paul, session is properly closed in destructor

    CMyClient::~CMyClient()
    {
    LOGRAMUSAGE();
    iConnection.Close();
    iSess.Close();
    iFileServ.Close();
    delete iReqBodySubmitBuffer;
    delete iTransObs;
    LOGRAMUSAGE();
    }


    Thanks Wiz, I do not get allocation panic.

    The worst part is that these allocation does not get free even if I exit the application. My assumption is that if the leakage was in user application, it would have been free when application exited. Since it remains allocated, could that be in kernel?

  9. #9
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Memory Leak in RHTTPTransaction

    If you have enabled extended panics as documented in the wiki and you still do not get a panic when exiting then all the memory is freed and all handles have been freed.

    My guess is there is something wrong with your logging code.
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  10. #10
    Regular Contributor
    Join Date
    May 2008
    Posts
    139

    Re: Memory Leak in RHTTPTransaction

    Quote Originally Posted by Paul.Todd View Post
    My guess is there is something wrong with your logging code.
    Hi Paul, logging code is fine and we use it for multiple projects. The problem is evident that after few hundre HTTP requests, phone starts showing the low memory symptoms and gives error like Memory full.

    Similar discussion here though it may not apply completely

    http://developer.symbian.com/forum/t...threadID=25888

  11. #11
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Memory Leak in RHTTPTransaction

    That issue had the connection to the socket server returning an -4 error, your case is that memory applications within your application are failing.


    It might be that your heap is very fragmented, but I almost certain that its a memory leak. You won't see the memory leaks on a real device as the devices have shipping ROM's, not debug ROMs.

    Run in the emulator to see the leaks and use hooklogger (avaiable from Symbian's website to track down the allocations)
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  12. #12
    Registered User
    Join Date
    Jan 2009
    Posts
    27

    Re: Memory Leak in RHTTPTransaction

    Quote Originally Posted by gammav View Post
    I see some memory leaks in RHTTPTransaction.

    Here is code snippet

    iTrans = iSess.OpenTransactionL(uri, *iTransObs, aMethod);
    ..
    ...
    iTrans.SubmitL();
    CActiveScheduler::Start();

    Immediately after iTrans.SubmitL() and in MHFRunL callback function, I can see that significant RAM is consumed. However, after completion of SubmitL, there is a portion of RAM which remains unrecovered.

    Any information.

    Hello gammav,
    Have you solve an issue with memory leaking (worst case: OOM). If so, could you please share your opinion for solving the problem

    With regards,
    Dmitry__

Similar Threads

  1. memory leak on emulator = memory leak on device
    By manmli in forum Mobile Java General
    Replies: 2
    Last Post: 2006-08-05, 19:54
  2. Memory Leak After Leave
    By gowthamyemme in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-02-23, 19:35
  3. Replies: 0
    Last Post: 2006-02-20, 11:51
  4. severe memory leak when using CSendAppUi ( Nokia 7650 )
    By ejurinsky in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2002-12-05, 10:13
  5. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×