The memory space for object is allocated when it is declared & not when the class is specified. The member functions are created & placed in memory space only once when they are defined as a part of a class definition. Since all the objects belonging to that class use the same member functions, no separate space is allocated for member functions. When the objects are created only space for (data) member variables is allocated separately for each object. Separate memory locations for the objects are essential because the (data) member variables will hold different data values for different objects.
In the above diagram, member functions 1 and 2 are stored in the common memory space as they require access by all objects. Each object (object 1, object 2, object 3) has its own separate memory space for its member variables.