xpress_embedo,
For complete understanding you have to read about the data alignment, padding and packing concepts.
question : first data memory changes , why ?
you have storage classes auto, static, register by default storage class is auto.
In first window, the reason you have no data memory as no variable present.
in second , u have an auto variable 'int' 2 bytes.
in third you mentioned as const variable,const is a type qualifier. The other type qualifier is volatile. The purpose of const is to announce objects that may be placed in read-only memory, and perhaps to increase opportunities for optimization. so you have 0 data memory and increased program memory.
question : 2Bytes can be increase in RAM but why 4 Bytes in ROM, Please explain me this.
in first window : may be due to saving of the paths of the projects and corresponding files .
second and third window it due to data alignment, it depends on the padding bits .
try out with static , volatile. instead of declaring it globally , declare as local variables check then you will not have any data memory but it will have program memory.
declaration of variables need to properly aligned or else you will waste a lot of program memory,where in optimization techniques comes in to picture !