I'm not an expert C++ developer so sorry to sound a bit "out of touch".
My thought is "why are you using global variables" in the first place?
I thought using global variables in a C++ application is considered "poor programming".
From my side, I am currently developing a fairly complex Ruby on Rails application and I have only one global variable, which I plan to "get rid off" after I complete the app.
Its a existing application that I am trying to analyze and make changes. First of all I need to know what is the memory global variables is taking - how much time it takes to load in memory . I understand that nm utility can provide the same but I am not sure
Then what we we can reduce its memory usage and replace global variables efficiently?
C++ compiler version used is MinGW C++ 8.1 / GCC-8.3.1.
Please let me know steps like -
How much space is global memory occupying or comes to in term of size
Approach to replace global variables
How much time does it takes to load these global variables in memory before the application starts executing