This is gcc 4.4.6 for Linux.
Here is the behavior
bizarre.c
double a[500000000];
main() {
}
If I compile this using:
gcc bizarre.c
Then the compiler uses 4G of memory and takes a lot of time.
If I make an array size of 50,000,000, compilation takes significantly less memory and time.
He, as a compiler, executes the code that he compiles.
I understand that creating a huge array in this way may not be the best practice, but any explanation?
source
share