sample code for free memory calculation

Login to reply to this topic.
Wed, 2005-11-09 06:09
Joined: 2005-07-28
Forum posts: 14
Hi,

I am new to symbian. Can anybody help me with sample code for finding out memory informaitons and CPU load while an application is running ?

Thanks in advance,
OJ

Wed, 2005-11-09 14:59
Joined: 2005-04-27
Forum posts: 28
Re: sample code for free memory calculation
On the forum nokia there is an example regarding Sysinfo. just check it.
Wed, 2005-11-09 19:30
Joined: 2005-11-07
Forum posts: 12
Re: sample code for free memory calculation
About Free memory,

Quote
TMemoryInfoV1Buf info;
UserHal::MemoryInfo(info);
TInt freeMemory = info().iFreeRamInBytes;

nuuneoi
Lead Developer
ZenitCore Co., Ltd.

Wed, 2005-11-09 22:30
Joined: 2005-01-22
Forum posts: 60
Re: sample code for free memory calculation
For being on the safe side (as TMemoryInfoV1Buf is deprecated) you can use this code:

Code:
int val;
HAL::Get(HALData::EMemoryRAMFree, val);
//val holds ram free bytes

A.
www.telesoftas.com

algis

Thu, 2005-11-10 05:47
Joined: 2005-07-28
Forum posts: 14
Re: sample code for free memory calculation
Hi,

Thanx for the replies. I already have got some APIs for ram, rom and free ram informations. I need to find out the overall CPU load as well as CPU load for each processes running and over all network activity also.

If anybody has any solution, please let me know.

Here is API which gives the memory informations:

User::LeaveIfError(HAL::Get(HALData::EMemoryRAM, iRamSize));
User::LeaveIfError(HAL::Get(HALData::EMemoryRAMFree, iFreeRamSize));
User::LeaveIfError(HAL::Get(HALData::EMemoryROM, iRomSize));

For people, who doesn't know this: Use these lines in any text or UI program and you can print the values either on the screen itself or write into a file.

Brs,
OJ
  • Login to reply to this topic.