Adding a variable of type REAL does not change the value shown in the Memory Consumption window.
Issue
Memory consumption window appears to be inaccurate.
Product Line
Unity Pro, Control Expert 14
Environment
Windows 10, Windows 7
Resolution
The memory consumption window appears to be inaccurate. If a new variable is added (i.e., REAL, etc.),
the value shown in the Memory Consumption window does not change.

This feature works as designed. The displayed value is correct. The reason for issue is due to the following he behavior:
For instance, if you, declare a variable of type BYTE (1 byte of memory is required). It could result in the
memory consumption screen increasing by 16 bytes with only 1 byte used. However, if you declare another variable with
same type (or another type), the value shown in the screen will not change because the remaining 15 bytes left is reserved for later
use on the next declared variables.
Variable constraint infers that the variable must be allocated in memory to an offset which is a multiple of its size.
The maximum variable alignment constraint is 4. This means that if you declare a variable using a type with a large byte
size (i.e., DDT or ARRAY). Unity does not use the type size for alignment constraint. Instead, it uses the value of 4.
A two (2 ) bytes size variable must be allocated to an offset multiple of 2. As a result, there could be a small gap
in memory.
i.e.,
If the 3 bytes of the 16 bytes were already allocated when a new two byte variable is added, the new variable would be assigned to the bytes 5 and 6.
Memory consumption window appears to be inaccurate.
Product Line
Unity Pro, Control Expert 14
Environment
Windows 10, Windows 7
Resolution
The memory consumption window appears to be inaccurate. If a new variable is added (i.e., REAL, etc.),
the value shown in the Memory Consumption window does not change.
This feature works as designed. The displayed value is correct. The reason for issue is due to the following he behavior:
- Variables are allocated in memory block.
- The size of a memory block is always a multiple of 16 bytes.
- Variable alignment constraint may generate small gaps in memory.
For instance, if you, declare a variable of type BYTE (1 byte of memory is required). It could result in the
memory consumption screen increasing by 16 bytes with only 1 byte used. However, if you declare another variable with
same type (or another type), the value shown in the screen will not change because the remaining 15 bytes left is reserved for later
use on the next declared variables.
Variable constraint infers that the variable must be allocated in memory to an offset which is a multiple of its size.
The maximum variable alignment constraint is 4. This means that if you declare a variable using a type with a large byte
size (i.e., DDT or ARRAY). Unity does not use the type size for alignment constraint. Instead, it uses the value of 4.
A two (2 ) bytes size variable must be allocated to an offset multiple of 2. As a result, there could be a small gap
in memory.
i.e.,
If the 3 bytes of the 16 bytes were already allocated when a new two byte variable is added, the new variable would be assigned to the bytes 5 and 6.
發佈於: 施耐德電機Taiwan
需要協助?
產品選型工具
快速輕鬆地為您的應用找到合適的產品和附件。
取得報價
立即線上提交您的銷售需求,專業團隊將主動聯繫您。
購買地點
輕鬆在您所在地區找到最近的施耐德電機經銷商。
支援中心
在同一位置找到滿足您所有需求的支援資源。