Hello everyone! I have a assignment where i am supposed to allocate memory in different size-able chunks, or so i think. Something like the size of the blocks should be 1GB and 1kB. I have been looking all over the internet for information regarding the size of the allocated memory i cant really understand it. I have made a program what thought was correct but i see no difference when executing them. All my memory gets used up until bad_alloc occurs. So am i missing something? I really dont understand.
Does this mean the array is a 5-byte chunk or is this 5 chunks of 1 bytes? I am so confused.
Well i am not sure to be honest. Based on how my assignment is i assumed that it would be two different outcomes but they are the same(identical) so thats why i am asking here is my program correct and does it really mean that my arrays are of a different size or are they just of a different length? I am still quite uncertain of it all.
I have to answer two different questions. They go like this loosely translated.
"Examine how much memory your program can allocate before your OS says "no". Do this by allocating memory in 1GB-bits(chunks)"
"Examine what happens in your OS when a program is leaking memory. Do this by allocating in memory in 1kB-bits(chunks)"
So this made me think it would be two different experiences.