Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - ROM Memory Calculation: (3 Items)
   
ROM Memory Calculation  
Hii,

In our application we trying to estimate the ROM memory consumed by all processes which are running currently, for this 
we are using "pidin pmem" on target and we are getting code, data and stack memory details of each process. In order to 
calculate overall used ROM, we are summing of code and data memory of all processes.

For example:
This is the output of "pidin pmem" output
   
     pid      tid     name                             prio       STATE               code        data        stack
       1         2     /procnto-smp-instr       255r     RECEIVE           758K     124K      8192(8192)
       3         1      proc/boot/pipe             10r       SIGWAITINFO     712K    744K      8192(516K)*
 1879        1      usr/sbin/qconn            10r       SIGWAITINFO    1084K   888K     8192(516K)*

To calculate overall ROM used,
Total ROM used =  758K+124K+712K+744K+1084K+888K
                               = 4310K
In our case this value is exceeding total available ROM. Is this is the way to calculate total used ROM? If it's wrong 
kindly suggest us how to do the same?

Thank you in Advance....

       
Re: ROM Memory Calculation  
Hi Sai,

I suppose you ment RAM but not ROM (so far you add the data segments in your total)...

The easiest way is to stat("/proc", &struct_stat), the "struct_stat.st_size" gives you the current free memory on your 
board. Try "ls -la /" on the command line as an illustration.

BR

Re: ROM Memory Calculation  
Hi Alexandre ,

We would like to know used data segment memory only on our board but not RAM memory. 

Thank you...