×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    66

    Where I place this function

    I am developing with Carbide.c++;
    I want to have some information about the memory consumption of the current thread (such as user::getalloccells)
    Where I must put this command? in appview.cpp, in ui.cpp, document.cpp or in application.cpp?
    or in another place?
    thanks in advance

  2. #2
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: Where I place this function

    You can achieve this using ctrl-alt-shift-a while on the emulator.

  3. #3
    Super Contributor
    Join Date
    May 2006
    Location
    Beijing,China
    Posts
    1,190

    Re: Where I place this function

    Quote Originally Posted by olfasupcom
    I am developing with Carbide.c++;
    I want to have some information about the memory consumption of the current thread (such as user::getalloccells)
    Where I must put this command? in appview.cpp, in ui.cpp, document.cpp or in application.cpp?
    or in another place?
    thanks in advance
    You can put it at anywhere. that function will get the current memory consumption. I think USER::CountAllocCells()
    [I][COLOR="Orange"]xhsoldier[/COLOR][/I]
    [email]xhsoldier@gmail.com[/email]/[email]xhsoldier@163.com[/email]

  4. #4
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    66

    Re: Where I place this function

    thanks a lot for help
    but where I can view the result? in the console view or in the emulator and how?

  5. #5
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: Where I place this function

    If using the hotkey, on the emulator screen, otherwise, depending how you want to show it..

  6. #6
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    66

    Re: Where I place this function

    sorry PushL but I am still beginner in symbian
    I don't know what means hotkey and how I can use it,
    I want to know just the result of this command so I don't need to have it in the UI in the emulator
    thanks a lot for help

  7. #7
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    66

    Re: Where I place this function

    Quote Originally Posted by PushL
    You can achieve this using ctrl-alt-shift-a while on the emulator.
    I did this command but the emulator show this message: heap failure mode reset.
    How can I solve this?

  8. #8
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: Where I place this function

    See http://wiki.forum.nokia.com/index.ph...short-cut_keys for a reference.

    Are you really pressing "A" instead of "Q"?

  9. #9
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    66

    Re: Where I place this function

    thanks a lot for help;
    but I don't want to show this in the emulator;
    I want to show it in a file text becouse I want to gather information about my application and then analyse this data.
    So how can I do this?
    thanks a lot for help

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,692

    Re: Where I place this function

    It is really up to you. You are the one who can decide when you would like to get information about the memory usage of your application. Create a logger method for this, and as a first try add a menu command invoking your method.

  11. #11
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    66

    Re: Where I place this function

    thank you Wizard_hu for reply
    but I don't know what's mean a logger method and how can I create it.
    Can you give me any link about this? an exemple of code would be helpful for me.

  12. #12
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    66

    Re: Where I place this function

    Hi!
    What do you mean? is a logger method means that I create a log file to gather information that I need?
    I propose to do this method: in every call to a class or a function I make some instruction to gather information I need from every function.
    Is there any method to call all the functions defined in my application?
    thanks a lot for help

  13. #13
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,692

    Re: Where I place this function

    Quote Originally Posted by olfasupcom
    I want to show it in a file text becouse I want to gather information about my application and then analyse this data.
    This is what you write in #9.

    Thus I was thinking that you might want to write a method like this
    Code:
    void Log()
    {
        RFs fs;
        fs.Connect();
        RFile file;
        _LIT(KFileName,"e:\\log.txt");
        TInt err=file.Open(fs,KFileName,EFileWrite);
        if(err==KErrNotFound)
            file.Create((fs,KFileName,EFileWrite);
        TInt pos=0;
        file.Seek(ESeekEnd,pos);
    
        TInt TotalAllocSize;
        TInt AllocCount1=User::AllocSize(TotalAllocSize);
        TInt BiggestBlock;
        TInt Available=User::Available(BiggestBlock);
        TInt FreeCount;
        TInt AllocCount2=User::AllocCount(FreeCount);
    
        _LIT8(KFormat8,"Allocated memory: %d Allocated cells: %d ?= %d Available memory: %d Biggest free block: %d Free cells: %d\n");
        TBuf8<200> buf8;
        buf8.Format(KFormat8,TotalAllocSize,AllocCount1,AllocCount2,Available,BiggestBlock,FreeCount);
        file.Write(buf8);
        file.Close();
        fs.Close();
    }
    and invoke it sometimes.

  14. #14
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    66

    Re: Where I place this function

    Hi Wizard_Hu!
    What you have give me is very helpful
    but where can I find the file generated ? in which directory? and what is her name? (I am working with 3rd edition SDK)
    thanks a lot
    Last edited by olfasupcom; 2007-05-15 at 09:49.

  15. #15
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,692

    Re: Where I place this function

    It should work on any SDK.
    You might consider replacing
    _LIT(KFileName,"e:\\log.txt");
    with
    Code:
    #ifdef __WINS__
    _LIT(KFileName,"c:\\log.txt");
    #else
    _LIT(KFileName,"e:\\log.txt");
    #endif
    since on the emulator there is no e: drive by default, but you can easily access the emulated c: drive (\Symbian\9.1\S60_3rd_MR\Epoc32\winscw\c), while on the device you can access drive e: easily when you are using USB Mass storage mode.

Similar Threads

  1. error LNK2019: unresolved external symbol ???
    By wgarnett in forum Symbian
    Replies: 3
    Last Post: 2009-09-28, 06:53
  2. ShortMsgReceived - Delphi
    By qb_soft in forum PC Suite API and PC Connectivity SDK
    Replies: 9
    Last Post: 2008-06-22, 10:30
  3. Cannot compile SDK's examples for 7650 platform...
    By midletsoft in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-08-12, 19:11
  4. Problem with Nokia D211 Linux Drivers
    By fiveam in forum Multimodecards
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

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