800xA 5.1: AC800m: Heap Utilization and "Non-used heap"
The Memory Organization table from the docs doesn't makes sense when compared to the Heap Utilization screenshot.
Looks like "Non-used heap" from the Heap Utilization dialog is really what's referred to as "Spare" in the docs?
Voted best answer
After discussion with concern team, I have following information:-
Modified Memory Organization chart:
è Project = Empty Project + Application(s)
è Executing firmware is the firmware you download before you download the application.
The size of the firmware can be found here (without protocol Handlers):
è Used by firmware is the Memory Consumptions of the protocols and CEX Units:
For example: if you use Comli with CI853 for PM866, then this consumes 72+2 Kbytes and adds to ‘Used by firmware’,
And if you add two CI854B for PM866, then this consumes 247 + 33 Kbytes and adds to ‘Used by firmware’.
Heap Utilization Diag:
Green part is the Executing Firmware.
Heap is shown above with red highlighted ellipse. It includes Used by Firmware + Project + Available Memory (spare). You can see 0 – 100 % for the heap.
Non-used heap (available memory) is the Spare memory.
Memory used only by the Application(s) cannot be seen here. If you wish to see memory used by the Application(s), then from Control Builder M, click on Tools from the menu bar and select Compiler Statistics from the drop down.
For more information, suppose you have only one application, say Application 1, then
Used by Firmware + Empty Project + Application 1 = Used shared heap (Yellow in Heap Utilization)
Making a change in the application and then during download, this application will first sit in the free memory (i.e. available memory) temporarily (this memory is the Max Used Shared Heap) -> then retain values will be copied from the application to the modified application -> then the running application is replaced by the modified application.
So, Used by Firmware + Empty Project + Application 1 + Application 1 = Max used shared heap (Now Yellow, but Yellow/White in Heap Utilization).
Then after downloading this part of heap is available again. (Now White, but Yellow/White in Heap Utilization)
Max Used Shared Heap memory is used temporarily during the download, and this is the reason why this is available memory.
Max used shared heap (used shared heap + temporarily used memory during download) should not go over 90% of the Heap, for a PA controller.
There should be space for 2 instances of the application.
It should be Non-used Heap > Max used shared Heap.
If you have only have one application then Spare memory needs to be 50%.
If you have >1 application, then the available Memory need to be > the biggest application. Then you can use the memory better; with the limitation you can only download one application at a time.
But the white space in the Heap Utilization dialog shows the Spare memory, and not the application memory. This is confusing. :D
You should be able to find out the memory used by the application by subtracting Used Shared Heap and Max Used Shared Heap.
As per document,
Total Memory = Used shared Heap( Empty Project+ Firmware used ) + Non-used Heap ( Spare + Application Memory) + Executing Firmware
the confusing part is the Max used Shared Heap. Actually it is the figure which shall provide information that how far the used shared heap memory can raise while doing online changes
As per your attachment
Heap utilization windows shows that used shared heap is 11.03 which shall be maximum used upto 15.04
Total Non used heap memory is 79.56 which included spare and application memory.
total RAM includes executing firmware along with both heaps
For example, refer below pics
In the above pics,32MB RAM
Firmware = 7.746
Max.used Shared Heap = 3.009
Non used heap = 21.245
Total=32MB that is Firmware execution + Max used Shared heap + Non used heap( Spare + Application) comprises your total RAM
I hope you will agree with it.