AC800m HI - Heap Utilization - How much memory is needed to perform a warm download?
The documentation says "As a general rule, an application should never exceed half the size of the available memory" and "The amount of spare memory must be at least 20% of available memory, and may require up to 50%.".
According the above thread, the memory used by the currently downloaded applications = "Max used Shared Heap" - "Used Shared Heap".
Is it right then to assume that as long as the following criteria is met, there will always be enough memory to perform a warm download?
A) "Non-used heap" >= "Max used Shared Heap" - "Used Shared Heap" and "Non-used heap" >= 20%
or perhaps this criteria?:
B) "Non-used heap" >= "Max used Shared Heap" - "Used Shared Heap" + "Max Used Protected Heap" and "Non-used heap" >= 20%
(I'm assuming that currently downloaded applications have constant memory usage, ie., there are no queues or arrays of varying size or anything)
Voted best answer
After discussion with concern team, I have the 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.