If the memory usage is not the actual memory usage of the application. Why would it be allocated in the first place.
so it's kinda confuse me, the way Windows allocate memory that isn't used by the application
I theory (and that's what you mostly need to know) you only allocate that space and practically you'll also only be able to work with that space.
But imagine an application like this:
for(unsigned int i = 0; i<10000; ++i)
{
int* k = new int;
delete k;
}
This now allocates and deletes 10000 times some integer. Now imagine your application would need to query the OS for each and every allocation to get some space (that is how memory management works, the OS is the 'master') your application would be horrible slow, because querying the OS doesn't take zero nanoseconds. Thus when you once request some space from the OS it allocates more than you actually need and if you delete it, the OS doesn't immediately take that back, so whenever you'd need more space the application already has some space left over and if that's not enough (anymore) it can request more.
This is just one aspect of the whole memory management thing and every OS handles it a bit different and I guess nobody can exactly say how every little detail in every situation works.
That doesn't mean it's not worth learn more on that topic, but it means that there's no reason to worry when you see a higher memory usage in the Task Manager than you'd have expected.
Also in my opinion it's not really a topic that should concern you
that much when starting of with programming. It's sure intelligent to not use too much resources for no reason, but trying to reduce/optimize code that doesn't really exist yet is not the best approach to programming, mainly because one could essential
always optimize further and thus one would never reach the wanted aim. So it's good to understand what is going on underneath and try to write code accordingly, but getting to a new programming language and library it's probably better to understand how to use the API first and then later maybe try to understand how it works underneath.
Summary: Programming is all about abstraction (e.g. if you know the interface of A you don't necessarily need to know how A connects with B).