Process Memory Used
Login to reply to this topic.
Tue, 2005-04-26 05:53
Joined: 2005-03-26
Forum posts: 19
Hai

I am trying to find out a particular process memory used.


I opened a process handle for a particular process and checked the process name then i used the following method

Rprocess::GetMemoryInfo(TProcessMemoryInfo& aInfo)

But the aInfo object
always returns Codsize as 624 and for other values it returns 0.

can any one help me.

thansk in advance
lakshmi priya.

Thu, 2007-07-05 11:26
Joined: 2007-06-22
Forum posts: 3

Hello lakshmi !
Have you solved the problem? I have the same one. If you've found the solution, please help me.

Thanks in advance.

Thu, 2007-07-05 12:39
Joined: 2004-11-29
Forum posts: 1419

If you always call it on the same process without modifying the code, and you don't have any global variables, I guess the described is what you would expect to get.
(codesize always the same, the other fields 0)

If you want to look at how much memory your process has allocated on the heap, with calls to new and User:Alloc etc, you should check the RHeap functions for this.
You can get a reference to the current heap by calling User::Heap()

Thu, 2007-07-05 13:12
Joined: 2007-06-22
Forum posts: 3

I try to launch a process, and to find out, how much memory it uses in general. So I use the following code:

//--------------------------------------------------------
        RProcess proc;
        TInt result = proc.Create( KMyAppName, KNullDesC);
                                                                                                       
        if (result == KErrNone)
                {
                proc.Resume();

                TModuleMemoryInfo meminfo={0};
                proc.GetMemoryInfo(meminfo);

                TUint32 size = meminfo.iConstDataSize + meminfo.iInitialisedDataSize + meminfo.iUninitialisedDataSize;     //    (1)

                TBuf<10> SizeMessage;
                _LIT(SizeTxt, "Size: %u");
                SizeMessage.Format(SizeTxt, size);
                CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
                informationNote->ExecuteLD(SizeMessage);

                proc.Close();
                }
//--------------------------------------------------------

Message is always: "Size: 0".

When I replace string (1) with the following:
TUint32 size = meminfo.iCodeSize + meminfo.iConstDataSize + meminfo.iInitialisedDataSize + meminfo.iUninitialisedDataSize;
My application breaks off.
Any ideas?

Thu, 2007-07-05 13:11
Joined: 2007-06-22
Forum posts: 3

I use Symbian 9.1.

Thu, 2007-07-05 14:03
Joined: 2003-01-14
Forum posts: 2133

Because of PlatSec restrictions, you must do that from within the process, not from an external process (unless you have the appropriate capability).


Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant


copyright 2003-2009 NewLC SARL